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
import sys | |
import itertools | |
if len(sys.argv) < 3: | |
raise IndexError("Not enough arguments!") | |
with open(sys.argv[1]) as words_file: | |
words = [a.strip() for a in words_file] | |
letters = sys.argv[2:] |
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
#!/bin/bash | |
fd=/proc/$1/fd/$2 | |
fdinfo=/proc/$1/fdinfo/$2 | |
name=$(readlink $fd) | |
size=$(wc -c $fd | awk '{print $1}') | |
while [ -e $fd ]; do | |
progress=$(cat $fdinfo | grep ^pos | awk '{print $2}') | |
echo $((100*$progress / $size)) | |
sleep 1 | |
done | dialog --gauge "Progress reading $name" 7 100 |
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 __future__ import print_function | |
import os | |
import time | |
from multiprocessing import Pool | |
from multiprocessing.dummy import Pool as ThreadPool | |
def images(): | |
"""Use a generator to read/process the list of images, | |
so map() can be used below""" |
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
with people as ( | |
select | |
-- name and age are the primary keys | |
'Quasar' as name, | |
30 as age, | |
'brown' as hair_color | |
from dual | |
union select | |
'Josh' as name, |
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
#!/bin/bash | |
# | |
# By Sirupsen @ http://sirupsen.dk | |
# | |
# Description: Very simple script to make you | |
# select a region of your screen, which will be captured, and | |
# then uploaded. The URL will then be injected into your clipboard. | |
# | |
# Dependencies: | |
# |
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
#!/usr/bin/env python2 | |
def reverse_str(string): | |
return string[::-1] # because there is no builtin :( | |
def is_palindrome(number): | |
if number < 10: | |
return True | |
num_str = str(number) |
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
! 66 = Capslock Key | |
keycode 66 = Super_L NoSymbol Super_L | |
! 133 = Left Windows Key | |
keycode 133 = Hyper_L NoSymbol Hyper_L | |
! 108 = Right Alt Key (remapped to tilde) | |
keycode 108 = grave asciitilde grave asciitilde | |
! 105 = Right Control Key | |
clear lock | |
clear mod5 | |
clear mod4 |
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 axe_quotes(line): | |
if '"' not in line: | |
return line | |
brackets = 0 | |
out = "" | |
for c in line: | |
if c == '<': | |
brackets += 1 | |
elif c == '>': |
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
--- /usr/lib/python2.7/site-packages/suds/transport/http.py 2015-06-09 17:40:15.000000000 -0500 | |
+++ http.py 2015-06-09 17:42:05.953929465 -0500 | |
@@ -19,6 +19,7 @@ | |
""" | |
import urllib2 as u2 | |
+import ssl | |
import base64 | |
import socket | |
from suds.transport import * |
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
13995651 function calls (13995631 primitive calls) in 31.438 seconds | |
Ordered by: standard name | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
5 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:1000(__init__) | |
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:1019(init_module_attrs) | |
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:1099(create) | |
2/1 0.000 0.000 0.004 0.004 <frozen importlib._bootstrap>:1122(_exec) | |
3 0.000 0.000 0.002 0.001 <frozen importlib._bootstrap>:1156(_load_backward_compatible) |
OlderNewer