sudo mkdir -p /usr/local/bin
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" | |
}; | |
}); | |
//factory style, more involved but more sophisticated |
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($) { | |
// the magic | |
delete window.jQuery; | |
delete window.$; | |
/** | |
* global interceptor | |
* business logic is safe inside the closure | |
*/ | |
$(document).ajaxSend(function(event, jqxhr, settings) { |
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
'use strict'; | |
const later = require('later'); | |
const logger = require('./logger')('guard'); | |
const pm2 = require('pm2'); | |
const schedule = later.parse.recur().every(10).second(); | |
// set local timezone | |
later.date.localTime(); |
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
server { | |
server_name gist.github.com | |
root /usr/share/gist; | |
index index.html | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
location /avenger/ { |
export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist
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
.scroll-wrapper { | |
-webkit-overflow-scrolling: touch !important; | |
overflow-y: scroll !important; | |
position: fixed; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
top: 0; | |
} |
yum install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
service ntpd start
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 to64bitFloat(number) { | |
var i, result = ""; | |
var dv = new DataView(new ArrayBuffer(8)); | |
dv.setFloat64(0, number, false); | |
for (i = 0; i < 8; i++) { | |
var bits = dv.getUint8(i).toString(2); | |
if (bits.length < 8) { | |
bits = new Array(8 - bits.length).fill('0').join("") + bits; |
OlderNewer