Skip to content

Instantly share code, notes, and snippets.

View yanzhihong23's full-sized avatar
🏠
Working from home

Hom yanzhihong23

🏠
Working from home
  • Shanghai
View GitHub Profile
@yanzhihong23
yanzhihong23 / command.md
Last active April 22, 2017 10:49
launch sublime text from the command line
sudo mkdir -p /usr/local/bin

sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
@yanzhihong23
yanzhihong23 / unlink-jquery.js
Last active March 25, 2017 09:49
Block jQuery from browser console
@yanzhihong23
yanzhihong23 / angular_providers.js
Created March 14, 2017 07:18
AngularJS Provider/Service/Factory Examples
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
@yanzhihong23
yanzhihong23 / 0_reuse_code.js
Created January 12, 2017 10:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console