What do you want to save?
Add Code snippet
New code examples
-
PHP 2022-03-27 12:45:03
laravel hasOne
use Illuminate\Database\Eloquent\Builder; // Retrieve posts with at least one comment containing words like foo%... $posts = App\Post::whereHas('comments', function (Builder $query) { $query->where('content', 'like', 'foo%'); })->get(); // Ret... Add solution -
C++ 2022-03-27 12:15:21
find the graph is minimal spanig tree or not
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; const int MAX = 1e4 + 5; int id[MAX], nodes, edges; pair <long long, pair<int, int> > p[MAX]; void initialize() { ... Add solution -
Shell/Bash 2022-03-27 11:50:13
vim search and replace between lines
# Basic syntax: :<start_number>,<end_number>s/search_text/replacement_text/g # Example usage: # Say you have a file with the following text and only want to change # mispeled to misspelled on lines 2 and 3: 1. I mispeled a word on this line ... Add solution -
Javascript 2022-03-27 11:30:14
how to check consecutive characters in javascript
var password = '5236aaa121'; for(var i = 0; i< password.length; i++) { var numberOfRepeats = CheckForRepeat(i, password, password.charAt(i)); //do something } function CheckForRepeat(startIndex, originalString, charToCheck) { var repeatC... Add solution
Best helpers
Ranking is empty