Skip to content

Instantly share code, notes, and snippets.

View kunev's full-sized avatar
🐻
I break things to see how they (don't) work | I pass the butter

Evgeni Ku kunev

🐻
I break things to see how they (don't) work | I pass the butter
View GitHub Profile
@kunev
kunev / pyServer.sh
Created August 25, 2011 14:36
Easy file sharing with commandline python
python -c 'import SimpleHTTPServer; SimpleHTTPServer.test()'
@kunev
kunev / gist:1189922
Created September 2, 2011 21:08
verbose function call snooping
import inspect
def print_args(func):
argspec = inspect.getargspec(func)
expected_arguments, expected_varargs = argspec.args, argspec.varargs
def rslt(*args, **kwargs):
print 'Calling {0}\n\tArguments: {1}\n\tKeyword arguments: {2}'.format(func.__name__, args, kwargs)
return_val = func(*args, **kwargs)
print '\n\tReturned value: {0}'.format(return_val)
@kunev
kunev / bg_spell_check.vim
Created November 13, 2011 21:21
Turn on Bulgarian spell check in vim
setlocal spell spelllang=bg
@kunev
kunev / sample_spec.rb
Created December 16, 2011 07:44 — forked from psstoev/sample_spec.rb
Sample spec for task 6(add a few missing shoulds)
# encoding: utf-8
describe GameOfLife::Board do
describe 'initialization' do
it 'accepts multiple coords in the constructor' do
board = new_board [0, 0], [1, 1], [2, 2]
end
end
describe 'corner cases' do
@kunev
kunev / gist:2938791
Created June 15, 2012 21:30
Watch information for torrents being downloaded with deluge
watch -n 5 "deluge-console info|ack-grep 'State: Downloading' -A 5 -B 2"
@kunev
kunev / smart_throttle.js
Created February 8, 2013 15:07
Custom throttle extender for knockout.js that throttles input but updates the binding immediately when blurring the text field bound to it. Based on the original throttle extender.
ko.extenders.smart_throttle = function(target, timeout) {
target['throttleEvaluation'] = timeout;
target['lastUpdatedValue'] = null;
var writeTimeoutInstance = null;
return ko.computed({
'read': target,
'write': function(value) {
if (value == target()) {
clearTimeout(writeTimeoutInstance);
@kunev
kunev / dark_twitter_batmop_fix.css
Last active December 19, 2015 13:59
dark twitter theme fix for new tweet actions
.vellip, .vellip:before,
.vellip:after,
.conversation-module > li:after,
.conversation-module > li:before {
background-color: #4E9E20;
}
.conversation-module>li:after, .conversation-module>li:before {
width: 2px;
left: -10px;
@kunev
kunev / github_zenburn_greenish.css
Last active December 21, 2015 19:09
github zenburn greenish
.commit-group-item .gobutton {
background-color: #2b2b2b;
background-image: none;
}
.commit-group-item:nth-child(2n+1) .gobutton {
background-color: #3f3f3f;
background-image: none;
}
function sum(a, b) { return a + b; }
function mult(a, b) { return a * b; }
Function.prototype.curry = function ( ) {
var slice = Array.prototype.slice,
args = slice.apply(arguments),
that = this;
return function ( ) {
return that.apply(null, args.concat(slice.apply(arguments)));
};
@kunev
kunev / url-pkcon
Created February 12, 2014 15:56
minimal script for isntalling rpm files from a URL with pkcon
#!/bin/bash
pkg_path=$1
filename=$(basename $pkg_path)
curl "$pkg_path" -o "$HOME/rpms/$filename"
pkcon install-local "$HOME/rpms/$filename"