Skip to content

Instantly share code, notes, and snippets.

View shri3k's full-sized avatar
🤖
automate all things

Yojan Shrestha shri3k

🤖
automate all things
  • Austin
View GitHub Profile
@shri3k
shri3k / python-es6-comparison.md
Created April 23, 2019 12:45 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@shri3k
shri3k / OpenWrt detect new device and send text message.md
Created March 6, 2019 16:05 — forked from jwalanta/OpenWrt detect new device and send text message.md
Detect new network devices connecting to OpenWrt and send text message
@shri3k
shri3k / check.js
Last active June 25, 2018 03:32
check
(function(win){
win.CHECK = function(){
return {
version: 'v1',
hello: function(){
console.log('hello');
}
}
};
}(window));
@shri3k
shri3k / redis_cheatsheet.bash
Created June 8, 2018 02:03 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@shri3k
shri3k / index.js
Last active February 19, 2018 18:35
Proxy Check
var fetch = require('node-fetch');
var agent = require('proxy-agent');
const proxyUri = process.env.HTTP_PROXY;
const targetUri = process.env.TARGET_URI;
var opts = {
method: 'GET',
agent: new agent(proxyUri)
};
@shri3k
shri3k / react-codemod
Created January 11, 2018 02:28
Replace React.PropTypes with prop-types package
codemod -d ./src --editor nvim --extensions js,jsx \
'(import React)(.*{\s*PropTypes.*})(.*)' \
"import PropTypes from 'propt-types';\n\1\3
codemod -d ./src --editor nvim --extensions js,jsx \
'(import React.*)(,\sPropTypes,?)(.*)' \
"import PropTypes from 'propt-types';\n\1\3
#Prefix
unbind C-b
set -g prefix C-a
#----
set -g mouse on
setw -g mode-keys vi
set-environment -g 'IGNOREEOF' 2
#no delay on passing keys
set -sg escape-time 1
#no more weird characters on mouse click
@shri3k
shri3k / suru.sh
Last active July 31, 2017 00:11
Bootstrap new library project in node
#!/bin/bash
PROJECT_NAME=$(basename $PWD)
git init .
npm init -y
curl -L https://www.gitignore.io/api/vim,node >> .gitignore
curl -L https://goo.gl/editorconfig > .editorconfig
# Readme Content
@shri3k
shri3k / destructuring.js
Created March 4, 2017 01:18 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@shri3k
shri3k / serve.js
Created September 20, 2016 21:47
simple_server
var http = require('http');
http.createServer(function(req,res){
res.writeHead(200, {"Content-Type": "text/plain"});
res.end('hello world');
}).listen(3000, "127.0.0.1");