Skip to content

Instantly share code, notes, and snippets.

To get a list of the issues for one of your repositories:

curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com/repos/:owner/:repository/issues

Then grep to your heart's desire.

@agconti
agconti / atom-with-jspm-and-typescript.md
Created May 4, 2016 13:47
How to reference packages installed with jspm with when TypeScript and Atom

Problem

Packages installed with jspm can't be found when trying to import them using TypeScript with Atom.

Soultion

Update your tsconfig.json to use the "filesGlob" property. This specifies all the files that Atom TypeScript should look at for import. By default Atom only looks at pacakges installed in node_modules.

Intros to Scala

Resources

@agconti
agconti / index.html
Created May 8, 2016 23:46
Fake Light
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bonjourno World</title>
</head>
<body>
<script id="vertex-shader" type="text/vertex-shader">
/**
* Multiply each vertex by the model-view matrix
@agconti
agconti / RedisTools.py
Created September 19, 2014 15:37
A class for checking redis queues and managing orphan jobs.
class RedisTools:
'''
A set of utility tools for interacting with a redis cache
'''
def __init__(self):
self._queues = ["default", "high", "low", "failed"]
self.get_redis_connection()
def get_redis_connection(self):
[{"date":"2011-10-01T04:00:00.000Z","New York":63.4,"San Francisco":62.7,"Austin":72.2},{"date":"2011-10-02T04:00:00.000Z","New York":58,"San Francisco":59.9,"Austin":67.7},{"date":"2011-10-03T04:00:00.000Z","New York":53.3,"San Francisco":59.1,"Austin":69.4},{"date":"2011-10-04T04:00:00.000Z","New York":55.7,"San Francisco":58.8,"Austin":68},{"date":"2011-10-05T04:00:00.000Z","New York":64.2,"San Francisco":58.7,"Austin":72.4},{"date":"2011-10-06T04:00:00.000Z","New York":58.8,"San Francisco":57,"Austin":77},{"date":"2011-10-07T04:00:00.000Z","New York":57.9,"San Francisco":56.7,"Austin":82.3},{"date":"2011-10-08T04:00:00.000Z","New York":61.8,"San Francisco":56.8,"Austin":78.9},{"date":"2011-10-09T04:00:00.000Z","New York":69.3,"San Francisco":56.7,"Austin":68.8},{"date":"2011-10-10T04:00:00.000Z","New York":71.2,"San Francisco":60.1,"Austin":68.7},{"date":"2011-10-11T04:00:00.000Z","New York":68.7,"San Francisco":61.1,"Austin":70.3},{"date":"2011-10-12T04:00:00.000Z","New York":61.8,"San Francisco":61.5,"A
@agconti
agconti / fabfile.py
Last active January 29, 2019 11:10
Fabfile for django 1.7 + for easily deploying on heroku.
import os
import random
import string
from fabric.api import env, local, require, lcd
from fabric.colors import cyan
from fabric.operations import prompt
current_dir = os.getcwd()
env.project_name = '{{cookiecutter.app_name}}'
const http = require("http")
const getWeather = () => new Promise((resolve, reject) => {
const options = {
hostname: 'nodejs.org',
path: '/dist/index.json',
method: 'GET',
};
http.get(options, (res) => {
@agconti
agconti / Fib.py
Created December 30, 2019 16:29
A gentle intro to dynamic programming!
class Solution_recursive:
"""
Runtime: O(2^n)
Spacetime: O(1)
The classic approach to solving the Fibonacci sequence. The code is elegant but its runtime isn't
very pretty. Its recursive nature necessitates that we calculate some values of f(n) multiple times.
Consider this call graph where duplicated calls are denoted with `~`:
fib(7)
@agconti
agconti / set-hosts.js
Created February 12, 2020 17:03
A script for pragmatically setting `/ect/hosts` with node.js
const { promisify } = require('util')
const { promises: fs } = require('fs')
const hostile = require('hostile')
const setHost = promisify(hostile.set)
const removeHost = promisify(hostile.remove)
const LOCALHOST = '127.0.0.1'
const hosts = [
[LOCALHOST, 'youralias'],
]