Skip to content

Instantly share code, notes, and snippets.

View j2labs's full-sized avatar

The Ghost Of J2 Labs j2labs

View GitHub Profile
@j2labs
j2labs / spider.py
Created November 21, 2014 15:20
Simple python spider
#!/usr/bin/env python
### To use, first install gevent and then requests
###
### $ pip install gevent requests
from gevent import monkey; monkey.patch_all() ### gevent first
import gevent
import json
@j2labs
j2labs / gist:a870015f4cb00dca0510
Last active August 29, 2015 14:10
sudoku.rb
#!/usr/bin/env ruby
class Solver
B = " "
attr_reader :sudoku_board
def initialize
@sudoku_board = [[B, 4, B, B, B, 5, B, 1, B],
[B, B, B, B, 1, B, 6, B, 9],
[6, B, 1, 9, 3, B, B, B, 4],
@j2labs
j2labs / gist:f09b6a2d0cf41b15d797
Last active October 9, 2017 17:25
Swift sudoku solver
#!/usr/bin/env xcrun swift
class Board {
let b = -1 // a blank, written as b so the board below looks nice
let hborder = "-------------\n"
let vborder = "|"
let width = 9
let height = 9
var board: [[Int]]
@j2labs
j2labs / gist:4a0a82b9d064219c15bb
Created August 7, 2014 17:48
fb earnings extrapolation
>>> q1 = 2.91
>>> q5 = q1 + (q1 * .67)
>>> q5
4.8597
>>> distance = q5 - q1
>>> halfway = distance / 2
>>> step = halfway / 2
>>> q1 + step + step + step + step == q5
True
>>> step
# Round 30: Things We Say
Hello Hackers.
Thank you to The Ladders for hosting the meetup. It was our second time there and we love the space. They're hiring, and there are a few hacker school alums over there so we know it's a great place for hackers to earn some dough. Reach out to John Connolly if you're interested: [email protected]
## Projects
### Gabe Ghearing
# Round 29: Last hurrah before we're officially old.
Hello Hackers.
Thank you NYU for hosting the meetup. That was our first time at NYU and the space was great.
## Projects
### Gabe Ghearing
@j2labs
j2labs / gist:7875008
Last active December 30, 2015 19:38
Thinking out loud on what Tobin might be like.
from tobin.querysets import RedisQuerySet
from schematics.models import Model
from schematics.types import StringType, IntType
class SomeModel(Model):
s = StringType()
i = IntType()
@j2labs
j2labs / gist:7848611
Last active December 30, 2015 15:29
A Brubeck demo showing how Jinja2 support works with the new plugin system.
#!/usr/bin/env python
from brubeck.servers.web import WebServer
from brubeck.handlers.web import WebMessageHandler
from brubeck.connections import WSGIConnection
from brubeck_templates.plugins import Jinja2Plugin
import sys
@j2labs
j2labs / gist:7132681
Created October 24, 2013 07:19
Hack And Tell wrapup 26
# Subject: Round 26, Wait, really?
Tonight was great. The hacks were awesome. The crowd was awesome.
But I wanna talk about something serious for a moment.
There has been a surge of interest in Hack And Tell and we're not great about handling it yet. The reality is that this community has turned into something bigger and better than we expected and we're learning how to organize it as we go. It was initially a group of 20 of us just hanging out at meetup's offices, where gWoz (Andrew, or GNU Woz which is also Andrew) worked at the time. I'd present twice, he'd present twice, and maybe a couple other folks would show something.
Andrew and I both grew up in punk rock communities, where people did whatever they wanted and everyone just accepted it. If you wanted anyone to care about what you were doing, you had to earn their eyes and their ears by doing something cool. Not too different from how our presenter list is made. We have ten slots to fill so we just pick the stuff we like best. If it's nea
@j2labs
j2labs / gist:7074542
Created October 20, 2013 20:00
Hack And Tell wrap up 25
# Subject: Round 25, by Tom Clancy (RIP)
So, uh... I guess this email would've been easier to write last month. Especially since Mr. Clancy was alive then.
Initially, the name was to joke around with how dramatic things sound if you say they're by Tom Clancy. "The Snow Was Falling, By Tom Clancy", and now you're thinking about snow landing on top of a crashed fighter jet on Christmas.
I guess we'd have a fallen drone and some sad operator. "This is where I lost J2D2 2. The first one was in Dumbo, on a dark and stormy night."
What am I even talking about?