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 / 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 / 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 / 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 / gist:2989438
Created June 25, 2012 16:00
django template 0.96 fime formatter (bet curent does it straight away)
{% ifequal today eachData.modification_timestamp.date %}
{{ eachData.modification_timestamp|date:"P" }}
{% else %}
{{ eachData.modification_timestamp|date:"jS F P" }}
{% endifequal %}
@lukmdo
lukmdo / catc.sh
Created July 14, 2012 19:16
show \t \n \r in file but as-is (kinda hexdump -c)
hexdump -v -e '"%_c"' FILE_PATH | gsed -e 's/\\n/\\n\n/g'
@lukmdo
lukmdo / siteUptimeMonitor.js
Created July 29, 2012 12:09
google apps script=js
var ONE_S = 1000,
ONE_M = 60*ONE_S,
ONE_H = 60*ONE_M,
RUN_EVERY = 5*ONE_M,
SLEEP_TIME = 30*ONE_M,
CHECK_URL = 'http://www.SITE.com',
NOTIFY_MAIL = '[email protected]',
NOTIFY_CALENDAR = '[email protected]';
$.fn.persistantPopover = function() {
var popoverTimeout;
function delay() {
popoverTimeout = setTimeout(function() {
$('.popover').hide();
}, 100);
}
return this.each(function() {
@lukmdo
lukmdo / gist:3327354
Created August 11, 2012 21:10
timeit.timeit for python2.5
import timeit
try:
timeit.timeit
except AttributeError:
# adding "Convenience function..." from py >= 2.7
timeit.timeit = lambda stmt="pass", setup="pass", timer=timeit.default_timer, number=timeit.default_number: \
timeit.Timer(stmt, setup, timer).timeit(number)
@lukmdo
lukmdo / gist:3844575
Created October 6, 2012 10:35
erlang rpc
[{N, rpc:call(N, os, cmd, ['date'])} || N <- nodes()].
@lukmdo
lukmdo / gist:3882501
Created October 13, 2012 00:18
apple keyboard keys