Skip to content

Instantly share code, notes, and snippets.

💭
hustlin'

Stephan Fitzpatrick knowsuchagency

💭
hustlin'
  • San Francisco
Block or report user

Report or block knowsuchagency

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@knowsuchagency
knowsuchagency / models.py
Last active Nov 10, 2015
my sqlalchemy eve experiment
View models.py
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import Column, String, Date, ForeignKey, Integer, Enum, DateTime, func
Base = declarative_base()
class CommonColumns(Base):
__abstract__ = True
@knowsuchagency
knowsuchagency / codingame.py
Last active May 7, 2016
Some example code for codingame smash the code contest. Lets you look up board state using (x, y) coordinates and un-fucks the print function.
View codingame.py
from functools import partial
from collections import namedtuple, MutableMapping, Counter, deque
from operator import itemgetter, attrgetter
import sys
import random
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
View hangman++.cpp
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <set>
using namespace std;
vector<int> get_indexes(string input_string, char letter){
/* Return a vector of integers indicating the indexes where the char is
View hangman++.cpp
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <set>
using namespace std;
vector<int> get_indexes(string input_string, char letter){
/* Return a vector of integers indicating the indexes where the char is
@knowsuchagency
knowsuchagency / example.py
Created Aug 27, 2016
in-class assignment
View example.py
"""
Hello foo.
This line won't output.
Foo Bar.
foooooooooo
"""
# The above text is in the ./file.txt file
def lines_with_foo(filepath):
with open(filepath) as infile:
View main.cpp
#include <iostream>
#include <array>
#include <map>
using namespace std;
// prototype swapArrays
void swapArrays(array<int, 5>& stdArray, int oldArray[5]);
bool containsPair(int hand[]) {
// Return a true if hand contains a pair else false
@knowsuchagency
knowsuchagency / gitless.rb
Created Oct 3, 2016
gitless homebrew formula template
View gitless.rb
class Gitless < Formula
desc "Gitless: a version control system"
homepage "http://gitless.com/"
url "https://github.com/scottsideleau/gitless/archive/master.tar.gz"
version "0.8.3"
sha256 "df212d6a3d377f90c46d03fd4216ecbbeb40055b62c0fe73b9c3aa165ea8f0af"
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libgit2"
@knowsuchagency
knowsuchagency / 04.pip
Created Oct 20, 2016
Gitless installation error log
View 04.pip
2016-10-14 14:41:25 -0700
/usr/local/Cellar/gitless/0.8.4/libexec/bin/pip
install
-v
--no-deps
--no-binary
:all:
--ignore-installed
/private/tmp/gitless--cffi-20161014-50894-1qhyea5/cffi-1.8.3
@knowsuchagency
knowsuchagency / bash-cheatsheet.sh
Created Oct 21, 2016 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
View decorators_example.py
import json
def introspect(func):
def inner(*args, **kwargs):
result = func(*args, **kwargs)
print('name:', func.__name__)
print('doc:', func.__doc__)
print('args:', args)
return result
You can’t perform that action at this time.