|-- master (latest version passed by QA)
| |-- dev (latest version passed by developers, complete and working)
|
|-- v0 (version 0.x.x)
| |-- i1 (addressing issue/task 1)
| |-- i2 (addressing issue/task 2)
| |-- i5 (addressing issue/task 5)
| |-- new (fork from v0)
|
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
#!/bin/sh | |
timeout() { | |
# Spawn a child process: | |
($1) & pid=$! | |
# in the background, sleep for x secs then kill that process | |
(sleep ${2:-'10'} && kill -9 $pid) & waiter=$! | |
# wait on our worker process and return the exitcode | |
wait $pid && exit_code=$? | |
# kill the waiter subshell, if it still runs |
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
# Put this in your ~/.gitconfig or ~/.config/git/config | |
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName> | |
[user] | |
name = Ramesh Kumar | |
email = [email protected] | |
[color] | |
# Enable colors in color-supporting terminals | |
ui = auto | |
[alias] | |
# List available aliases |
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
import urllib2, json | |
reqopener = urllib2.build_opener(urllib2.HTTPHandler) | |
""" | |
To resolve template string from variable dictionary | |
Input: | |
@strvar: string on which replacement to be made | |
@varsdict: the dictionary that will be used to resolve the template object | |
Returns: | |
The resolved value, or the as it is string if not resolved by variable dictionary |
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
git fetch geeks | |
git checkout ramesh | |
git merge me | |
git add .coffee | |
git commit -am "some nerd made me nerd" |
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
const { createServer } = require('http') | |
const { createReadStream } = require('fs') | |
const { parse } = require('url') | |
const { extname, resolve } = require('path') | |
const PORT = 9000 | |
const HOST = '0.0.0.0' | |
const DOC_HANDLER = process.env.J2S_DOC_HANDLER || '_doc' | |
const DOC_CHECK = process.env.J2S_DOC_CHECK | |
const BASE_PATH = process.env.J2S_BASE_PATH || '/v0' |
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
/** | |
* clone a string or object | |
* @param {object|string} input - the input to the function. | |
* @return {object|string} output - the cloned data. | |
*/ | |
const clone = function clone(input) { | |
if (typeof input === 'string') return input; | |
return Object.assign({}, input); | |
}; |
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
/** | |
* stringify if not already string | |
* @param {*} input - the input to the function. | |
* @return {string} output - the stringified data. | |
*/ | |
const stringify = function stringify(input) { | |
if (typeof input === 'string') return input; | |
if (typeof input === 'object') { | |
try { | |
return JSON.stringify(input); |
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
'use strict'; | |
console.log('--> Loading function'); | |
const aws = require('aws-sdk'); | |
const s3 = new aws.S3({ apiVersion: '2006-03-01' }); | |
const waf = new aws.WAF({ apiVersion: '2015-08-24' }); | |
class Police { |
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 isRightPattern (actual, expected){ | |
if(expected instanceof RegExp){ | |
return expected.test(actual); | |
} else { | |
return actual === expected; | |
} | |
} | |
function extractPatterns(obj,expected) { | |
if(!obj || typeof obj !== 'object') return {}; |