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 pdb | |
import atexit | |
import os | |
import readline | |
from pathlib import Path | |
class Config(pdb.DefaultConfig): | |
sticky_by_default = 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
a = [] | |
a[0] = a |
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
printf '\nexport PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl http://npmjs.org/install.sh | sh |
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
setting = Hash.new("Some default string") | |
setting[0] = "some string" | |
setting[1] = "some other string" | |
postLoginAction = 0 | |
puts setting[postLoginAction] | |
postLoginAction = 1 | |
puts setting[postLoginAction] | |
postLoginAction = 5 | |
puts setting[postLoginAction] |
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
Buffers Tools Python Help | |
import random | |
def flip(n): | |
on_tails = -1000 * 1000 | |
if n == 0: | |
return 1 | |
elif random.random() < 0.5: | |
return on_tails | |
else: |
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
jQuery.fn.extend insertAtCaret: (myValue) -> | |
@each (i) -> | |
if document.selection | |
@focus() | |
sel = document.selection.createRange() | |
sel.text = myValue | |
@focus() | |
else if @selectionStart or @selectionStart is "0" | |
startPos = @selectionStart | |
endPos = @selectionEnd |
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 artistic_black_and_white(image, order=2): | |
pix = pixel_array(image) | |
draw = ImageDraw.Draw(image) | |
for y in range(image_height(image)): | |
for x in range(image_width(image)): | |
r,g,b = pix[x,y] | |
grey_value = (r + g + b)/3 | |
adjusted_value = int(((grey_value / 255.0) ** (1 / float(order)) * grey_value)) | |
r = adjusted_value |
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 | |
def clean(): | |
for root, dirs, files in os.walk(os.getcwd()): | |
for f in files: | |
p = os.path.join(root, f) | |
if p[-1] == "~" or p[-4:] == ".pyc": | |
os.remove(p) | |
if __name__ == '__main__': |
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 Point(object): | |
def __init__(self): | |
self.x = None | |
self.y = None | |
a = Point() | |
b = Point() | |
a.x = 20 | |
a.y = 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
155.254.225.2 Afghanistan, Kabul | |
194.112.11.130 Aland Islands, Mariehamn | |
104.167.254.2 Albania, Tirana | |
45.59.177.2 Algeria, Annaba | |
104.224.33.2 Anguilla, The Valley | |
104.224.1.2 Antigua and Barbuda, Saint John's | |
200.55.243.196 Argentina, Buenos Aires | |
45.59.129.3 Armenia, Tsaghkadzor | |
104.224.32.2 Aruba, Palm Beach | |
203.31.216.1 Australia, New South Wales, Sydney (LOC1 S1) |
NewerOlder