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 wx | |
class Frame(wx.Frame): | |
def __init__(self): | |
super(Frame, self).__init__(None) | |
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) | |
self.Bind(wx.EVT_PAINT, self.OnPaint) | |
self.SetTransparent(200) |
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
// allows using all Jquery AJAX methods in Greasemonkey | |
// inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php | |
// works with JQuery 1.5 | |
// (c) 2011 Martin Monperrus | |
// (c) 2010 Ryan Greenberg | |
// | |
// Usage: | |
// $.ajax({ | |
// url: '/p/', | |
// xhr: function(){return new GM_XHR();}, |
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
# Takes an image URL and uploads it to imgur.com, calling the callback with the resulting image URL | |
urlToImgur = (url, callback) -> | |
upload_url = "http://api.imgur.com/2/upload?url=#{url}" | |
$.ajax | |
url: 'http://query.yahooapis.com/v1/public/yql' | |
dataType: 'jsonp' | |
data: { | |
q: "select none from html where url='#{upload_url}'" | |
diagnostics: 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
((window, document, requirements, callback) -> | |
getScript = (url, callback) -> | |
script = document.createElement('script') | |
script.src = url | |
head = document.documentElement.childNodes[0] | |
done = false | |
script.onload = script.onreadystatechange = -> | |
if not done and (not (readyState = @readyState) or readyState == 'loaded' or readyState == 'complete') | |
done = true | |
callback() |
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
grid = [ | |
[1,2,3,4] | |
[5,6,7,8] | |
[9,0,9,8] | |
] | |
grid2 = [] | |
for i in grid[0] | |
grid2.push [] |
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 List extends Array | |
constructor: (args...) -> | |
super args | |
list = new List(1,2,3,4) | |
console.log list |
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 random | |
import sys | |
import numpy | |
X = 20 | |
Y = 20 | |
# the following creats a two dimensional array | |
# of indexes. Each cell now has a number, and we can convert co-ordinates | |
# into numbers via this array |