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
javascript: | |
if (typeof jQuery == 'undefined') { | |
var jQ = document.createElement('script'); | |
jQ.type = 'text/javascript'; | |
jQ.onload=runthis; | |
jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; | |
document.body.appendChild(jQ); | |
} | |
else { | |
runthis(); |
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
class UploadImage(): | |
""" | |
Upload images to imgur | |
returns either .error or .imageURL | |
TO DO: | |
POSSIBLE TO DO: | |
- add stats and image info functions | |
- allow for full JSON responses instead of having to manually parse XML |
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 python | |
from Tkinter import * | |
import sys, commands, os | |
root = Tk() | |
root.title('Printer Configuration') | |
root.config(bg="lightblue") | |
def getPrinter(): | |
nIndex = printerList.curselection()[0] |
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
mysqlcheck -u root -p --auto-repair --all-databases |
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 os | |
d = os.walk(some_dir) | |
m = {} | |
for root,dir,files in d: | |
m[root] = files | |
for key in m.keys(): | |
print "Key => ",key," is ",len(key.split('/')) |
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
# finding authentication errors in all message log files | |
grep -r "authentication error" messages* | awk '{split($0,a," "); print a[NF],a[NF-2]}' > attempts | |
# username | |
cut -d ' ' -f2 attempts | sort -k 2,2 | uniq -c | sort -nr > attempts_username | |
# IP | |
cut -d ' ' -f1 attempts | sort | uniq -c | sort -nr > attempts_ip |
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(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
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
x = [[[1, 2, 3, 4], [9, 8, 7, 6]], [[10, 20, 30, 40], [90, 80, 70, 60]]] | |
from itertools import chain | |
[[y[i] for y in list(chain.from_iterable(x))] for i in range(0,len(x[0][0]))] |
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 itertools import chain | |
[[y[i] for y in list(chain.from_iterable(x)) if y[i] and y[i] < 200] for i in range(0,len(x[0][0]))] |
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
<?php | |
/** | |
* The template for displaying Comments. | |
* | |
* The area of the page that contains both current comments | |
* and the comment form. The actual display of comments is | |
* handled by a callback to twentyten_comment which is | |
* located in the functions.php file. | |
* | |
* @package WordPress |
OlderNewer