Skip to content

Instantly share code, notes, and snippets.

View ninja-webdev's full-sized avatar

Joe2 Palala ninja-webdev

View GitHub Profile
@ninja-webdev
ninja-webdev / git_pull_script.sh.md
Created June 1, 2017 05:31 — forked from jpalala/git_pull_script.sh.md
create a simple deploy script by issuing git pull on the directory of the folder

#simple- cd to directory with the git initialized and pull origin develop or master echo "Running deployment" cd /var/www/html git pull origin develop echo "Repo updated with develop"`

@ninja-webdev
ninja-webdev / python_bst.py
Created March 9, 2017 14:39 — forked from bshyong/python_bst.py
Python BST implementation
class BSTnode(object):
"""
Representation of a node in a binary search tree.
Has a left child, right child, and key value, and stores its subtree size.
"""
def __init__(self, parent, t):
"""Create a new leaf with key t."""
self.key = t
self.parent = parent
self.left = None
@ninja-webdev
ninja-webdev / egg.js
Created March 2, 2017 13:39 — forked from wldcordeiro/egg.js
The Egg programming language from Eloquent JS Chapter 11
function parseExpression(program) {
program = skipSpace(program);
var match, expr;
if (match = /^"([^"]*)"/.exec(program)) {
expr = {type: "value", value: match[1]};
} else if (match = /^\d+\b/.exec(program)) {
expr = {type: "value", value: Number(match[0])};
} else if (match = /^[^\s(),"]+/.exec(program)) {
expr = {type: "word", name: match[0]};