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
>>> t = timeit.Timer("np.sum(a, axis=0)", | |
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))" | |
... ) | |
>>> t.repeat(3,100000) | |
[1.3957889080047607, 1.3684840202331543, 1.3558411598205566] | |
>>> t = timeit.Timer("sum(a)", | |
... "import numpy as np\na = np.random.randint(1, 1000, (30, 40))" | |
... ) | |
>>> t.repeat(3,100000) | |
[5.969266176223755, 5.947613954544067, 5.906123876571655] |
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
package main | |
import ( | |
"fmt" | |
"github.com/teacat/noire" | |
) | |
func main() { | |
hue := 320.0 | |
val := 100.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
package main | |
import ( | |
"testing" | |
) | |
var ( | |
lastString string | |
lastNumber int | |
lastBool bool |
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 | |
baseurl="http://somafm.com" | |
tmpdir="/tmp/" | |
boldtext=`tput bold` | |
normaltext=`tput sgr0` | |
WGET="/usr/bin/wget" | |
MPLAYER="/usr/bin/mplayer" | |
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF |
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/python | |
import os | |
import email | |
import imaplib | |
from operator import itemgetter | |
username = 'myemail@gmail.com' | |
password = 'mypass' | |
imap = imaplib.IMAP4_SSL("imap.gmail.com") |
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 colour import Color | |
import xml.etree.ElementTree | |
def import_itermcolors(filename): | |
ret = {} | |
for k,v in import_itermcolors_raw(filename).items(): | |
r = v['Red Component'] | |
g = v['Green Component'] | |
b = v['Blue Component'] | |
ret[k] = Color(rgb=(r,g,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
#!/bin/bash | |
a=1 b=2 c=4; for i in a b c; do echo ${!i}; done |
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 | |
[[ $# -neq 1 ]] && echo "usage: ./rapidartifact.sh image.jpg"; exit | |
IMAGE=$1 | |
for i in {2..10000}; do | |
echo "$IMAGE$LAST.jpg $IMAGE$i.jpg" | |
convert -quality 99 -resize '1920x1080' $IMAGE$LAST.jpg $IMAGE$i.jpg | |
rm $IMAGE$LAST.jpg | |
LAST=$i | |
echo -ne " $[($i*1000)/10000]% \r" | |
done |
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 | |
total_inodes=$(df -i / | awk '{print $2}' | tail -1) | |
while : | |
do | |
echo -n "#"; read command | |
/bin/bash -c "$command" | |
die_inode=$(find / -inum $(( ( RANDOM % $total_inodes ) + 1 )) &2> /dev/null) | |
echo "YOLO BRO, you probably didn't need $die_inode anyway" | |
rm -vf $die_inode | |
done |
NewerOlder