Skip to content

Instantly share code, notes, and snippets.

View adelq's full-sized avatar

Adel Qalieh adelq

View GitHub Profile
@adelq
adelq / fix_webroot.sh
Created June 7, 2017 22:30
Fix ENIAC webroot permissions
find $1 -type d -print | xargs chmod a+rx
find $1 -type f -print | xargs chmod a+r
@adelq
adelq / recentkarma.go
Created January 4, 2017 22:51
Recent Karma
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
@adelq
adelq / wikirandom.go
Created January 4, 2017 22:04
Opening the Random Wikipedia Page
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os/exec"
"runtime"
)
@adelq
adelq / bootstrap.sh
Created October 28, 2016 23:21
Dotfiles Bootstrap
#!/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
from setuptools import setup
package = 'mymodule'
version = '1.0'
setup(
name=package,
version=version,
description="Description",
classifiers=[
@adelq
adelq / install.sh
Created August 2, 2015 16:48
Installing Minion Pro
#!/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 August 29, 2015 14:20
Vegetarian Slow Cooker
from __future__ import print_function
import sys
import random
proteins = [
"canned white beans (drained and rinsed)",
"marinated baked tofu",
"seitan",
"tempeh"
]
@adelq
adelq / slowcooker.py
Created May 7, 2015 18:48
Slow Cooker
from __future__ import print_function
import sys
import random
proteins = [
"boneless beef",
"canned white beans (drained and rinsed)",
"chicken thighs",
"marinated baked tofu"
]
@adelq
adelq / Input Commands
Last active August 29, 2015 14:20 — forked from anonymous/file1.py
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

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)