| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.sun.net.httpserver.* | |
| Object.metaClass.webapp = { | |
| { path -> | |
| try { | |
| def attrs = path.split('/')[1..-1] | |
| [200, owner.delegate.invokeMethod(attrs.head(), attrs.tail() as Object[]) as String] | |
| } catch (Exception e) { | |
| [500, e as String] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # for gvm to autopick grails version only when cd in a grails proyect | |
| alias autopick='AUTO_VERSION=`grep app.grails.version application.properties` ; AUTO_VERSION=${AUTO_VERSION:19}; gvm use grails $AUTO_VERSION' | |
| chdir() { | |
| local action="$1"; shift | |
| case "$action" in | |
| # popd needs special care not to pass empty string instead of no args | |
| popd) [[ $# -eq 0 ]] && builtin popd || builtin popd "$*" ;; | |
| cd) | |
| if [ $# -eq 0 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def model = [model:[book:[title:"The Shinning"]]] | |
| def magicMethod= { String exp -> | |
| def out = [:] | |
| out.result = Eval.x(model,"x.with{${exp}}") | |
| try{ | |
| if(out.result){ | |
| Eval.x(model,"x.with{assert !(${exp})}") | |
| }else{ | |
| Eval.x(model,"x.with{assert ${exp}}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.getElementById("referencia").innerHTML = parseInt(document.getElementById("referencia").innerHTML,10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Map toUncamelizedKeyMap(Map map){ | |
| (map+[:]).each{k,v-> | |
| map[k.replaceAll(/([A-Z])/,'_$1').toLowerCase()] = v | |
| } | |
| return map | |
| } | |
| Map toCamelizedKeyMap(def map){ | |
| (map+[:]).each{k,v-> | |
| def camelized = k.split("_").collect({"${it[0].toUpperCase()}${it[1..-1]}"}).join() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resultado=`grep $1 nota.txt` | |
| if [ "$resultado" = "" ]; then | |
| echo "no encontro" | |
| else | |
| echo "encontro" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){var%20s=document.createElement("script");s.src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js";s.onload=function(){var%20my_options=$("#roles%20option");my_options.sort(function(a,b){if(a.text>b.text){return%201;}else{return%20-1;}});$("#roles").empty().append(my_options);};document.body.appendChild(s);})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.twttr=window.twttr||{}; | |
| var D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,u=encodeURIComponent(F.location.href),t=encodeURIComponent(F.title); | |
| if(C>A){ | |
| G=Math.round((C/2)-(A/2)) | |
| } | |
| window.twttr.shareWin=window.open('http://linksdeviernes.com/add.php?url='+u+'&titulo='+t,'','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #find $1 -type f -print0 | xargs -0 sed -i 's/$2/$3/g' | |
| echo $1 $2 $3 | |
| grep -rl $2 $1 | while read fn; do | |
| echo "replacing in $fn $2 for $3" | |
| sed -i "s/$2/$3/g" $fn | |
| done |
NewerOlder