Skip to content

Instantly share code, notes, and snippets.

@adelq
adelq / fix_webroot.sh
Created Jun 7, 2017
Fix ENIAC webroot permissions
View fix_webroot.sh
find $1 -type d -print | xargs chmod a+rx
find $1 -type f -print | xargs chmod a+r
View recentkarma.go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
@adelq
adelq / wikirandom.go
Created Jan 4, 2017
Opening the Random Wikipedia Page
View wikirandom.go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os/exec"
"runtime"
)
@adelq
adelq / bootstrap.sh
Created Oct 28, 2016
Dotfiles Bootstrap
View bootstrap.sh
#!/usr/bin/env bash
set -eu
########## Variables
dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory
files=`ls -A ~/dotfiles/$1` # list of files/folders to symlink in homedir
View setup.py
from setuptools import setup
package = 'mymodule'
version = '1.0'
setup(
name=package,
version=version,
description="Description",
classifiers=[
@adelq
adelq / install.sh
Created Aug 2, 2015
Installing Minion Pro
View install.sh
#!/bin/sh
## Information
## http://carlo-hamalainen.net/blog/2007/12/11/installing-minion-pro-fonts/
## http://www.ctan.org/tex-archive/fonts/mnsymbol/
## 0.1: Install LCDF Typetools
## http://www.lcdf.org/type/
## If you use Homebrew (http://mxcl.github.com/homebrew/), then uncomment:
# brew install lcdf-typetools
@adelq
adelq / slowcooker_veg.py
Last active Aug 29, 2015
Vegetarian Slow Cooker
View slowcooker_veg.py
from __future__ import print_function
import sys
import random
proteins = [
"canned white beans (drained and rinsed)",
"marinated baked tofu",
"seitan",
"tempeh"
]
View slowcooker.py
from __future__ import print_function
import sys
import random
proteins = [
"boneless beef",
"canned white beans (drained and rinsed)",
"chicken thighs",
"marinated baked tofu"
]
View Input Commands
from biom import parse_table
with open('otu_table_hunter.biom') as f:
table = parse_table(f)
print table
table.ids()
table.ids(axis='observation')
table.nnz
normed = table.norm(axis='sample', inplace=False)
phylum_idx = 1
View labs-challenge.md

Labs Coding Challenge

Write a concise piece of code that sends an HTTP POST request to labs.yef.im with the following pieces of data:

  • javascript: Your level of comfort with JavaScript, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • python: Your level of comfort with Python, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • coffeescript: Your level of comfort with Coffeescript, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • frameworks: Your level of comfort with web frameworks, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • url: The URL of a GitHub Gist with the code that does this.(Meta! Note that you might have to edit the Gist a few times)