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
| Promise = function() { | |
| this.check = []; | |
| this.resolved = false; | |
| }; | |
| Promise.prototype = { | |
| success: function(callback){ | |
| if (this.resolved) { | |
| callback(this.results); | |
| } else { |
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 sum = 0; | |
| for (var i= 2; i < process.argv.length; i++){ | |
| sum += Number(process.argv[i]); | |
| } | |
| console.log(sum); |
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 fs = require('fs'); | |
| var arg = process.argv; | |
| var buf = fs.readFileSync(arg[2]); | |
| var txt = buf.toString().split('\n').length -1; | |
| console.log(txt); | |
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 fs = require('fs') | |
| , path = require('path') | |
| , dirPath = process.argv[2] | |
| , filter = process.argv[3]; | |
| fs.readdir(dirPath, function(err, data){ | |
| if (err) { throw err; } | |
| for (file in data){ |
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
| input:-webkit-autofill { | |
| -webkit-text-fill-color : #fff; | |
| box-shadow : 0 0 0px 1000px #333 inset; | |
| } |
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
| AddType text/css scss sass |
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
| local url = "https://gist.github.com/zerosquadron/d36b66f4a99a54797402/raw/gfs.lua" | |
| local body = http.get(url).readAll() | |
| local handle = fs.open("/gfs", "w") | |
| handle.write(body) | |
| handle.close() |
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 newKeyWord(funct) { | |
| // we're given an array-like object containing all arguments; | |
| const args = arguments; | |
| //create our object and link it to the prototype chain; | |
| let obj = Object.create(funct.prototype); | |
| // use from to turn our array-like into an array; | |
| args = Array.from(args) |
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
| # Path to your oh-my-zsh installation. | |
| export ZSH=~/.oh-my-zsh/ | |
| export JAVA_8_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/bin/java" | |
| export JAVA_7_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home" | |
| export JAVA_6_HOME="/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/jre/bin/java" | |
| #default java8 | |
| export JAVA_HOME=$JAVA_8_HOME |
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 |
OlderNewer