Skip to content

Instantly share code, notes, and snippets.

@koorchik
koorchik / var_issue.js
Created July 17, 2015 14:06
Scope issue in javascript
var obj = { name: 'koorchik', age: 31 };
var funcs = {};
for (var prop in obj) {
funcs[prop] = function() { return obj[prop] };
}
console.log( funcs.name(), funcs.age() );
@nzjrs
nzjrs / FooThread.py
Created January 25, 2009 04:43
PyGtk threading example
# Demo application showing how once can combine the python
# threading module with GObject signals to make a simple thread
# manager class which can be used to stop horrible blocking GUIs.
#
# (c) 2008, John Stowers <john.stowers@gmail.com>
#
# This program serves as an example, and can be freely used, copied, derived
# and redistributed by anyone. No warranty is implied or given.
import gtk
import gobject