Skip to content

Instantly share code, notes, and snippets.

View necccc's full-sized avatar

Szabolcs Szabolcsi-Toth necccc

View GitHub Profile
@necccc
necccc / tito-activites.md
Last active November 20, 2015 15:08
Tito Tickets and Activities

Tito Tickets and "Activities"

The name "Activities" can narrow one’s mindset, think about them as “Constraints” that overlap tickets.

Rule of thumb:

if an Activity count reaches zero, any ticket that is associated with that Activity, is SOLD OUT, zero amount remaining

Expected example ticket setup:

me: why dont you let me to ride the metro?
bkv ellenor: nincs jegye!
me: ? excuse me? do you speak english?
bkv ellenor: (speaking slowly) nincs …. jegye…
// npm install mocha sinon chai
// test.js
var assert = require('chai').assert;
var sinon = require('sinon');
var mymodule = require('./mymodule');
suite('mymodule', function () {
@necccc
necccc / gist:9124078
Last active August 29, 2015 13:56 — forked from cyx/gist:3690597
check process redis-server
with pidfile "/var/run/redis/redis-server.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@necccc
necccc / git shorts
Last active December 25, 2015 06:29
git merge workflow helper
# work branch to feature branch
w2b = "!f() { b=\"$1\"; w=`git status --porcelain -bs|awk 'NR==1{print $2}'`; if [[ ! $w =~ "work" ]]; then echo "Not on a workbranch! Aborting..."; exit 1; fi; git checkout branches/$b; git pull; git merge $w --no-ff; }; if [[ $? == 0 ]]; then git checkout $w; fi; f"
# work branch to feature branch with push
w2bp = "!f() { b=\"$1\"; w=`git status --porcelain -bs|awk 'NR==1{print $2}'`; if [[ ! $w =~ "work" ]]; then echo "Not on a workbranch! Aborting..."; exit 1; fi; git checkout branches/$b; git pull; git merge $w --no-ff; if [[ $? == 0 ]]; then git push; if [[ $? == 0 ]]; then git checkout $w; fi; fi; }; f"
# work branch to master
w2m = "!f() { w=`git status --porcelain -bs|awk 'NR==1{print $2}'`; if [[ ! $w =~ "work" ]]; then echo "Not on a workbranch! Aborting..."; exit 1; fi; git checkout master; git pull; git merge $w --no-ff; if [[ $? == 0 ]]; then git checkout $w; fi; }; f"
# work branch to release tag
@necccc
necccc / flickr-remove-yahoo-bar.js
Created July 2, 2013 13:12
Userscript to remove the ugly yahoo bar from the top of *.flickr.com
// ==UserScript==
// @match http://*.flickr.com/*
// ==/UserScript==
try {
var eyebrow = document.querySelectorAll('#eyebrow')[0];
eyebrow.parentNode.removeChild(eyebrow);
document.querySelectorAll('body')[0].className = document.querySelectorAll('body')[0].className.replace('with-eyebrow', '');
} catch (e) {}