Skip to content

Instantly share code, notes, and snippets.

View lukmdo's full-sized avatar
:octocat:
loading...

Lukasz Dobrzanski lukmdo

:octocat:
loading...
View GitHub Profile
@lukmdo
lukmdo / self_delay.js
Created June 4, 2012 22:26
self-delaying function
// quite same what _.debounce does http://underscorejs.org/#debounce
function self_delay(delay, just_run){
delay = delay || 3000;
clearTimeout(self_delay.sheduled);
if (!just_run){
self_delay.sheduled = setTimeout(self_delay, delay, 0, true);
return;
}
@lukmdo
lukmdo / googleappengine-python-dev_appserver.diff
Created March 24, 2012 15:04
dev_appserver [googleappengine-python] pip-installable
diff --git a/dev_appserver.py b/dev_appserver.py
index 0276d25..ed1e519 100755
--- a/dev_appserver.py
+++ b/dev_appserver.py
@@ -23,7 +23,7 @@
import os
import re
import sys
-
+import google
@lukmdo
lukmdo / gae_log_colorize.awk
Last active October 15, 2017 07:19
colorize gae logs filter
#!/usr/bin/env awk -f
# CCZE alternative (https://github.com/cornet/ccze)
BEGIN {
RED="\033[0;31m"
YELLOW="\033[0;33m"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
LIGHT_RED="\033[1;31m"
LIGHT_GREEN="\033[1;32m"
@lukmdo
lukmdo / refine_github_geeks.json
Created January 5, 2012 21:43
Google Refine script Github 4people
// More than https://github.com/about
// Uses https://api.github.com/orgs/github/members as data source and fetches user data from the url field
[
{
"op": "core/column-addition-by-fetching-urls",
"description": "Create column userData at index 1 by fetching URLs based on column url using expression grel:value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
@lukmdo
lukmdo / gist:1373525
Created November 17, 2011 16:01
apple  wird commands

Add existing user to existing group

sudo dseditgroup -o edit -a USERNAME -t user GROUPNAME

Google Notifier AutocheckInterval

defaults write com.google.GmailNotifier AutocheckInterval EVERY_N_MINUTES
defaults delete com.google.GmailNotifier AutocheckInterval # to reset

Enabling/disabling at family commands

@lukmdo
lukmdo / chunk_iterable.py
Created October 24, 2011 14:45 — forked from ksamuel/chunk_iterable.py
Function to iterate over an iterable chunk by chunk, choosing the number of item of each chunks and the type of the chunk
from itertools import chain, islice
def chunk(seq, chunksize):
""" Yields items from an iterator in iterable chunks."""
it = iter(seq)
while True:
yield chain([it.next()], islice(it, chunksize - 1))
if __name__ == '__main__':
lst = ['a', 'b', 'c', 'd', 'e']
@lukmdo
lukmdo / Git tricks
Created July 1, 2011 16:38
Git tricks
git add -p
git stash -p
git reflog
gitk --all `git reflog |cut -c1-7`
git status -M --find-copies-hard
git grep "supae"
git log -S "supae" -p
git log -P
@lukmdo
lukmdo / CGI test
Created July 1, 2011 16:36
CGI local testing
export REQUEST_METHOD="GET";
export PATH_INFO="ws/keywords";
export QUERY_STRING="cid=523&tgid=54&begin=20100701&end=20100712";
perl ./cgi/seo2.cgi
@lukmdo
lukmdo / eclipse
Created May 15, 2011 13:18
Eclipse stuff
CSS Editor
Eclipse Web Developer Tools
Google App Engine Java SDK
Google Plugin for Eclipse
Google Web Toolkit SDK
PyDev for Eclipse
WTP
Apache MyFaces Trinidad Tag Support (Optional)
Code Coverage - CodePro
@lukmdo
lukmdo / gist:951514
Created May 2, 2011 12:12
NFS server setup
1) # vim /etc/exports:
# What_to_share With_whom
ABS_PATH IP(rw,all_squash,anonuid=XXX,anongid=YYY,insecure)
# `all_squash` - turns on mapping. Each file created/modified on the client will be mapped to user
# configured by `ananuid` and `anangid` on the server side.
# `anonuid` - id of server side user of the changed files
# `anangid` - gid of server side group of the changed files
# `insecure` - lests in all requests form port higher then 1024