Skip to content

Instantly share code, notes, and snippets.

@smn
smn / baba.sonicpi.rb
Last active June 17, 2017 01:15
binary black sheep do you have any wool?
# CDEFGABC
the_song = <<-BA_BA_BLACKSHEEP
10000000
10000000
00001000
00001000
00000100
00000100
00001000
00001000
diff --git a/go-app-ussd_public.js b/go-app-ussd_public.js
index 2dc4816..8584a68 100644
--- a/go-app-ussd_public.js
+++ b/go-app-ussd_public.js
@@ -648,7 +648,10 @@ go.app = function() {
return Q(true);
}
// Otherwise check the API
- return new JsonApi(self.im, {'Authorization': 'Token ' + api_token})
+ return new JsonApi(self.im, {
@smn
smn / .slate
Created May 7, 2013 12:03
ShiftIt key-bindings for Slate
# Key bindings for Slate to match ShiftIt's defaults.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Push Bindings
bind right:ctrl;alt;cmd push right bar-resize:screenSizeX/2
bind left:ctrl;alt;cmd push left bar-resize:screenSizeX/2
bind up:ctrl;alt;cmd push up bar-resize:screenSizeY/2

Keybase proof

I hereby claim:

  • I am smn on github.
  • I am smn (https://keybase.io/smn) on keybase.
  • I have a public key whose fingerprint is BF1A 432A 53E4 7D67 C0B9 FE99 6937 911D 7CAA 7748

To claim this, I am signing this object:

{"content":"this is the response"}
diff --git a/vumi/persist/fake_redis.py b/vumi/persist/fake_redis.py
index 5cfc84e..11aec86 100644
--- a/vumi/persist/fake_redis.py
+++ b/vumi/persist/fake_redis.py
@@ -484,6 +484,6 @@ class Zset(object):
return score
def zremrangebyrank(self, start, stop):
- deleted_keys = self._zval[start:stop+1]
- del self._zval[start:stop+1]
@smn
smn / -
Created December 11, 2013 14:52
vumi/persist/model.py: def raw_search(cls, manager, query):
vumi/persist/model.py: def raw_search(self, query):
@smn
smn / 0_reuse_code.js
Created December 5, 2013 19:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
الله معك
@smn
smn / python-example.txt
Created August 18, 2013 06:42
Brackets are only used for grouping a calculation, the resulting value of the calculation in the bracket group is used as the value for the next bit. And subtracting a negative number results in a positive number
$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> -2
-2
>>> - -2
2
>>> (-2)
-2