This file contains 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
description "nodejs server" | |
author "sagar - http://sagarpanda.com" | |
# used to be: start on startup | |
# until we found some mounts weren't ready yet while booting: | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn: | |
respawn |
This file contains 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
What really happens when we create an object using `new` keyword | |
- allocate memory for the object | |
- Class.call(object); | |
- object.prototype = Class.prototype | |
/******* CASE 1 ********/ | |
var Car = function(year){ | |
this.year = year; | |
this.mile = 0; | |
this.drive = function(dist){ |
This file contains 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 onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ]; | |
ss.addMenu("HTTP Archive + BigQuery", menuEntries); | |
} | |
function runQuery() { | |
var projectNumber = 'httparchive'; | |
var sheet = SpreadsheetApp.getActiveSheet(); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function curry(fn){ |
- Remove
_site
or build folder from.gitignore
file. - Add build directory to git traking folder or commits changes to build directory.
- Push changes to github
gh-pages
branch
# replace build_folder as appropriate
git subtree push --prefix build_folder origin gh-pages
This file contains 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 propMap = { | |
val: "value", | |
html: "innerHTML" | |
}; | |
for(var fnName in propMap){ | |
$.prototype[fnName] = function(prop){ | |
return function(){ | |
return this[prop]; | |
} |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
This file contains 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
/** | |
* To Array | |
*/ | |
function toArray(args) { | |
return [].slice.call(args); | |
} | |
/** | |
* Curry function | |
*/ |
OlderNewer