⌘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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
// You can add new locales by adding a new object to the `XDate.locales` hash. | |
// You can change the default locale by changing `XDate.defaultLocale`. | |
XDate.locales['fr'] = { | |
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'], | |
monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin','Juil.','Août','Sept.','Oct.','Nov.','Déc.'], | |
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], | |
dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'] | |
}; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
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
function (destination, duration) { | |
// destination (relative to window top) in px | |
// duration in ms | |
/* Variables */ | |
var startPosition = "pageYOffset" in window ? window.pageYOffset : document.documentElement.scrollTop, | |
startTime = +new Date(), | |
endTime = startTime + duration, | |
// if top of element is outside the document, then define end point to document limit | |
// elsewhere, go the the top of the element | |
destinationSafe = document.height < (destination + window.innerHeight) ? document.height - window.innerHeight : destination, |
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
notification : function(sUrl, sTitle, sContent, onDisplay, onClick, onClose) | |
{ | |
if(window.webkitNotifications) { // Test si webkitNotifications de Chrome | |
if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED | |
var notif = window.webkitNotifications.createNotification( | |
sUrl, // icon url - can be relative | |
sTitle, // notification title | |
sContent // notification body text | |
); |
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
Show hidden characters
{ | |
"caret_style": "phase", | |
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme", | |
"default_encoding": "Western (ISO 8859-1)", | |
"detect_slow_plugins": false, | |
"draw_minimap_border": true, | |
"fallback_encoding": "Western (ISO 8859-1)", | |
"font_face": "Source Code Pro", | |
"font_size": 16, | |
"highlight_line": true, |
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
app.directive('ngFocus', ['$parse', function($parse) { | |
return function(scope, element, attr) { | |
var fn = $parse(attr['ngFocus']); | |
element.bind('focus', function(event) { | |
scope.$apply(function() { | |
fn(scope, {$event:event}); | |
}); | |
}); | |
} | |
}]); |
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
'3423112'.replace(/\d(?=(?:\d{3})+$)/g,'$&,') | |
"3,423,112" | |
'3423112'.replace(/(?!^)(?=(?:\d{3})+$)/g,',') | |
"3,423,112" |
OlderNewer