This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require('fs') | |
# Import ENV from zsh config. | |
fs.readFile process.env.HOME+"/.zshrc", "utf8", (err, zshFile) -> | |
envPaths = ['/usr/local/bin'] | |
for l in zshFile.split('\n') | |
if l.substring(0,11) is 'export PATH' | |
e = l.split('=').splice(-1)[0] | |
e = e.replace(':$PATH','').replace(/"/g,'') | |
if ':' in e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import json | |
import requests | |
class Chimpo(object): | |
endpoint = 'http://chimpo.co/shortener/v1' | |
"""docstring for Chimpoco""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.4.3-onbuild | |
RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections && \ | |
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections && \ | |
apt-get update && apt-get install -q -y \ | |
mysql-client libmysqlclient-dev \ | |
postgresql-client libpq-dev \ | |
sqlite3 \ | |
gcc \ | |
mysql-server \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
error_log(var_export($_SERVER, true)); | |
exit; | |
} | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
const { id, label, inputs } = this.props; | |
return ( | |
<div> | |
this.props.inputs.values.map((value) => { | |
let defaultChecked = (value == inputs.defaultCheckedValue); | |
return ( | |
<label className="radio-inline"> | |
<input type="radio" ref={id + value} name={id} value={value} defaultChecked={defaultChecked}/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
🏃 := make(chan int) | |
💨 := make(chan int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class Controller: UITableViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell") | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename = isset($argv[1]) ? realpath($argv[1]) : null; | |
$mixin = isset($argv[2]) ? $argv[2] : 'sprite-mixin'; | |
$retina = isset($argv[3]) ? true : false; | |
if (!$filename) { | |
echo "fail", PHP_EOL; | |
exit(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
usage() { | |
echo "Usage: `basename $0` [template repo] [project name]" | |
echo " e.g.: `basename $0` https://github.com/user/repo.git prjectname" | |
exit 1 | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import simplejson | |
from django.http import HttpResponse | |
from django.conf import settings | |
class JSONResponse(HttpResponse): | |
def __init__(self, request, data): | |
content = simplejson.dumps(data, indent=indent) |