Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| <?php | |
| # Plivo AUTH ID | |
| $AUTH_ID = ''; | |
| # Plivo AUTH TOKEN | |
| $AUTH_TOKEN = ''; | |
| # SMS sender ID. | |
| $src = ''; |
| <?php | |
| function raindrops($drops) { | |
| $output = ''; | |
| if ($drops%3 == 0) { | |
| $output .= "Pling"; | |
| } | |
| if ($drops%5 == 0) { |
| <?php | |
| function toRna($nucleotides) { | |
| $dnaToRna = [ | |
| "G" => "C", | |
| "C" => "G", | |
| "T" => "A", | |
| "A" => "U" | |
| ]; | |
| return strtr(strtoupper($nucleotides), $dnaToRna); |
| <?php | |
| function isPangram($param) { | |
| $sentences = strtolower(trim($param)); | |
| $letters = str_split("thequickbrownfoxjumpsoverthelazydog"); | |
| foreach ($letters as $letter) { | |
| if (!strstr($sentences, $letter)) | |
| return false; | |
| } | |
| return true; |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| <?php | |
| function isIsogram($phrase){ | |
| $array_phrase = str_split(strtolower(preg_replace('/[\s-äöü]/', '', $phrase))); | |
| return count($array_phrase) == count(array_unique($array_phrase)); | |
| } |
| <?php | |
| //in controller if there is only a single function | |
| public function __invoke(){ | |
| } | |
| //in routes just call controller name without @(function name) |
| //in model Reply.php | |
| protected $appends = ['favoritesCount']; | |
| //so when data are being called from this model, element favoritesCount are included in the json/array | |
| //another example from stackoverflow |
| /* | |
| This snippet is esssentially the same as being in the Twitter longer tweets test, for tweetdeck. | |
| The Tweet length counter is fixed by tricking TweetDeck into counting up to 140 characters, twice, so you'll see 140 | |
| instead of 280 in the counter but going over 140 will give you another set of 140 charactrs. | |
| */ | |
| TD.services.TwitterClient.prototype.makeTwitterCall=function(b,e,f,g,c,d,h){c=c||function(){};d=d||function(){};b=this.request(b,{method:f,params:Object.assign(e,{weighted_character_count:!0}),processor:g,feedType:h});return b.addCallbacks(function(a){c(a.data)},function(a){d(a.req,"",a.msg,a.req.errors)}),b}; | |
| twttrTxt=Object.assign({},twttr.txt,{isInvalidTweet:function(){return!1},getTweetLength:function(x){return x=twttr.txt.getTweetLength.apply(this,arguments),x<140||x/140>2?x:x%140}}); |