This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dpkg-reconfigure tzdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simulatedClick(target, options) { | |
var event = target.ownerDocument.createEvent('MouseEvents'), | |
options = options || {}; | |
//Set your default options to the right of || | |
var opts = { | |
type: options.click || 'click', | |
canBubble:options.canBubble || true, | |
cancelable:options.cancelable || true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python, #elegant, #example | |
def fib(n): | |
" Generate fib sequence up to n " | |
a, b = 0, 1 | |
while (b < n): | |
print b | |
a, b = b, a + b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quicksort(lst, left=0, right=None): | |
if right is None: | |
right = len(lst) - 1 | |
l = left | |
r = right | |
if l <= r: | |
mid = lst[(left+right)/2] | |
while l <= r: | |
while l <= right and lst[l] < mid: | |
l += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
down vote accepted | |
From http://erikvold.com/blog/index.cfm/2010/6/14/using-jquery-with-a-user-script | |
// ==UserScript== | |
// @name jQuery For Chrome (A Cross Browser Example) | |
// @namespace jQueryForChromeExample | |
// @include * | |
// @author Erik Vergobbi Vold & Tyler G. Hicks-Wright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from optparse import OptionParser | |
from collections import defaultdict | |
def run(inputWord): | |
a, states = open("avtomat.txt") ,defaultdict(list) | |
state, final= a.readline().split()[1:],a.readline().split()[1:] | |
[states[(i.split()[0], i.split()[1])].append(i.split()[3]) for i in a] | |
for letter in inputWord: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/14721406/pythonic-way-to-determine-whether-not-null-list-entries-are-continuous?newsletter=1&nlcode=83359%7c512e | |
from itertools import groupby | |
def contiguous(seq): | |
return sum(1 for k,g in groupby(seq, lambda x: x is not None) if k) == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx -V 2>&1 | tr -- - '\n' | grep _module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if all(u in POST for u in ('skill', 'description')): |
OlderNewer