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
{ | |
// Name of configuration; appears in the launch configuration drop down menu. | |
"name": "Run mocha", | |
// Type of configuration. Possible values: "node", "mono". | |
"type": "node", | |
// Workspace relative or absolute path to the program. | |
"program": "/usr/local/lib/node_modules/mocha/bin/_mocha", | |
// Automatically stop program after launch. | |
"stopOnEntry": false, | |
// Command line arguments passed to the program. |
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 readline = require('readline'); | |
var reader = readline.createInterface({ | |
input: fs.createReadStream('data.txt') | |
}); | |
reader.on('line', (line) => { | |
console.log(line); | |
}); |
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
import( | |
"reflect" | |
"time" | |
"github.com/gorilla/schema" | |
) | |
func ConvertFormDate(value string) reflect.Value { | |
s, _ := time.Parse("2006-01-_2", value) | |
return reflect.ValueOf(s) | |
} |
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 Future = require('fibers/future'); | |
var fs_f = Future.wrap(require('fs')); | |
if(process.argv.length < 3) { | |
console.log("format filestat <path>"); | |
process.exit(); | |
} | |
function processFileStats(stat) { | |
console.log(stat); |
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
boil any vegetables you like until very tender (till they can be mashed easily) | |
(tradtional version always contains potatoes, cauliflower and green peas). | |
Add 1-2 table spoons of oil. | |
Add cumin seeds. | |
Add 1-2 red onions and fry till golden. | |
Add 1 table spoon of ground ginger. | |
Add 1 table spoon of ground garlic. | |
Add 1-2 green chilies. | |
Add 1 teaspoon of cumin powder. |
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 off | |
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
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
sambhar powder | |
lentils | |
salt | |
chilli powder | |
onions tomatoes | |
fenugreek seeds - 1 tablespoon | |
mustard seeds - 1 tablespoon | |
cumin seeds - 1 tablespoon | |
curry leaves |
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
let factors n = | |
let rec factorizer i n res = | |
if i > int(n/2) then n::res | |
else | |
if n % i = 0 then | |
factorizer (i+1) n (i::res) | |
else | |
factorizer (i+1) n res | |
factorizer 2 n [] |
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
let is_prime n = | |
match n with | |
|n when n < 2 -> false | |
|n when n = 2 || n = 3 -> true | |
|n when n % 2 = 0 || n % 3 = 0 -> false | |
|n -> | |
let rec check i rootn n = | |
if i > rootn then true | |
else | |
if n % i = 0 then false |
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
let sieve upperbound = | |
let ar = Array.create (upperbound+1) 1 | |
for i in 2.. (ar.Length - 1) do | |
let endi = int (floor (float (upperbound/i))) | |
for j in i..endi do | |
ar.[i * j] <- 0 | |
seq{for i in 2..(ar.Length - 1) do if ar.[i] = 1 then yield i} |