Skip to content

Instantly share code, notes, and snippets.

@lsemel
lsemel / hacky.txt
Last active November 5, 2018 18:37
"Hacky" (parody of "Tacky" by Weird Al, parody of Pharrell's "Happy")
It might seem crazy, writing CSS
When I could code in Bootstrap, SASS or Less
My entire database is CSV
I use Mac OS 7 from 1993
[Chorus:]
(my code is hacky)
Spend my day in Sublime Text 3, and wear Tattly tattoos
(my code is hacky)
If you don’t star my repo, I’ll down vote you on Hacker News
@lsemel
lsemel / gist:2b52ba807975900ce80a
Last active August 29, 2015 14:04
Example of chainable django queryset methods (for Django 1.6 and lower)
from django.db import models
from django.db.models import query
class PersonQuerySet(query.QuerySet):
def some_query(self):
return self.filter(...)
def some_other_filter(self):
return self.filter(...)
PRAGMA page_size=1024;
BEGIN;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y TEXT);
WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<250)
INSERT INTO t1(x,y) SELECT x*10, printf('%04d%.800c',x,'*') FROM c;
SAVEPOINT one;
SELECT count(*) FROM t1;
WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<250)
INSERT INTO t1(x,y) SELECT x*10+1, printf('%04d%.800c',x,'*') FROM c;
ROLLBACK TO one;