Skip to content

Instantly share code, notes, and snippets.

@jscn
jscn / hello.js
Created December 17, 2011 21:44
Hello world: node.js & jasmine-node
function hello_world() {return "Hello, world!";}
exports.hello_world = hello_world;
@jscn
jscn / install.sh
Created April 28, 2012 23:29
Installing Io
wget http://iobin.suspended-chord.info/linux/iobin-linux-x86-deb-current.zip
unzip iobin-linux-x86-deb-current.zip
sudo dpkg -i IoLanguage-2012.03.02-Linux-x86.deb
@jscn
jscn / base.py
Created July 18, 2012 11:28
Django Models and the ==, 'in' and 'is' operators
def __eq__(self, other):
return isinstance(other, self.__class__) and self._get_pk_val() == other._get_pk_val()
@jscn
jscn / forms.py
Created August 19, 2012 08:02
Dynamic forms with class based generic views.
class SearchForm(forms.Form):
"""
Search for users.
"""
# Search fields.
first_name = forms.CharField()
last_name = forms.CharField()
email = forms.CharField()
@jscn
jscn / demo.py
Created November 8, 2016 03:47
Demo of pylint wrong-import-position errors
"""
Demo of wrong-import-position
"""
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
from future import standard_library
@jscn
jscn / components.my-component.js
Created January 15, 2018 02:02
checkbox-toggle
import Ember from 'ember';
export default Ember.Component.extend({
model: null,
});
---- MODULE name ----
EXTENDS \* whatever
Expected(inout) ==* ...
Helpers == \* ...
(*--algorithm name
variables
inut \in \* ...