This file contains hidden or 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 | |
| # An enhancement to the "python" executable that automatically launches you into the python debugger on error. | |
| # | |
| # Use it like you would the "python" executable, for example: | |
| # $ trypy somefile.py | |
| # or | |
| # $ trypy somefile.py arg1 arg2 | |
| # | |
| # EXAMPLE: |
This file contains hidden or 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
| execve("/usr/local/bin/copyq", ["copyq", "-s", "zsh", "show"], [/* 67 vars */]) = 0 | |
| brk(0) = 0x21b6000 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9593757000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=151268, ...}) = 0 | |
| mmap(NULL, 151268, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9593732000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) |
This file contains hidden or 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
| public class OAuth { | |
| public static HttpRequest signRequest(HttpRequest req, String consumerKey, String consumerSecret) { | |
| String nonce = String.valueOf(Crypto.getRandomLong()); | |
| String timestamp = String.valueOf(DateTime.now().getTime() / 1000); | |
| Map<String,String> parameters = new Map<String,String>(); | |
| parameters.put('oauth_signature_method','HMAC-SHA1'); | |
| parameters.put('oauth_consumer_key', consumerKey); | |
| parameters.put('oauth_timestamp', timestamp); |
This file contains hidden or 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
| # After spending too much time away from Python on Javascript, I gave this a shot. To my surprise, it worked! | |
| # Since Python doesn't bind "self" explicitly in classes, this looks almost exactly like Python classes. | |
| # The only visible difference is that you cannot simply access the members using the dot syntax (cat.sayHi). | |
| # It must be accessed as a dictionary. | |
| def Cat(legs, colorId, name): | |
| def sayHi(): | |
| print 'Hi, my name is %s. I have %s legs and am %s.' % (this['name'], this['legs'], this['color']) | |
| this = { |
This file contains hidden or 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
| while true | |
| do | |
| echo -n "stats.timers.kamon.localhost.system-metric.cpu.cpu-user.mean_99:$(((RANDOM % 10) + 1))|c" | nc -w 1 -u localhost 8125 | |
| done |
This file contains hidden or 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 multiprocessing as mp | |
| import os | |
| import time, random | |
| def f(x): | |
| b = x*x | |
| time.sleep(random.choice([5,8,10,14,20])) | |
| print "{0} procces id {1} with parent {2} doing {3}".format(mp.current_process(), os.getpid(), os.getppid(), x) | |
| return b |
This file contains hidden or 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
| # source this code in a Bash shell ($ . django-csrftoken-login-demo.bash), | |
| # and run with a DB name as parameter (e.g. $ django-csrftoken-login-demo demo) | |
| django-csrftoken-login-demo() { | |
| # -- CHANGE THESE VALUES TO MATCH YOUR ACCOUNT -- | |
| local HOSTING_USERID=9988 | |
| local HOSTING_PANEL_USER='customer@email.address' | |
| local HOSTING_PANEL_PASS='my secret login password' | |
| local HOSTING_DB_PREFIX='username_' | |
| local DB_NAME=$HOSTING_DB_PREFIX$1 |
This file contains hidden or 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
| These two symbols look correct in my terminal, before I was seeing > and < | |
| " My own hack for the seperator | |
| let g:airline_left_sep = '' | |
| let g:airline_right_sep = '' |
This file contains hidden or 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
| When using Noir, you must install the newer version of leiningen, you may place it on path within the /bin/ folder. | |
| verify correct usage with which lein. | |
| https://raw.github.com/technomancy/leiningen/stable/bin/lein |
This file contains hidden or 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
| // ==UserScript== | |
| // @name PissApOff | |
| // @namespace http://use.i.E.your.homepage/ | |
| // @version 0.1 | |
| // @description enter something useful | |
| // @include http://fifa1404.herokuapp.com/view/1 | |
| // @include http://fifa1404.herokuapp.com/ | |
| // @copyright 2012+, You | |
| // ==/UserScript== |