Skip to content

Instantly share code, notes, and snippets.

Avatar
🥐
Brunchin'

Hais Deakin Hais

🥐
Brunchin'
View GitHub Profile
@Hais
Hais / generate_xcode_assets.sh
Last active Jan 26, 2016
Generate XCode assets
View generate_xcode_assets.sh
#!/bin/bash
CAT_NAME=${PWD##*/}
XCASSETS_DIR="./${CAT_NAME}.xcassets"
mkdir $XCASSETS_DIR
for SVG_FILE in *.svg
View index.coffee
csv = require 'csv'
request = require 'superagent'
require('superagent-retry')(request);
cheerio = require 'cheerio'
fs = require 'fs'
async = require 'async'
require('debug-http')()
INFILE = "deals2.csv"
OUTFILE = "OUTPUT-#{INFILE}"
View workspace.sh
#!/bin/bash
# where to store the sparse-image
WORKSPACE=${HOME}/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
automount() {
@Hais
Hais / class.php
Last active Aug 29, 2015
php-trait-issue
View class.php
<?php
trait Bar {
public function jsonSerialize() {
return ["switch" => static::$SWITCH];
}
}
class Foo implements JsonSerializable {
public static $SWITCH = false;
@Hais
Hais / index.php
Last active Aug 29, 2015
CannedREST
View index.php
<?php
# Run as:
# php -S 0.0.0.0:80 -t . index.php
# A GET Request of
# http://127.0.0.1/3/en/mobile/merchant/nearby?longitude=-0.127758&latitude=51.5073509&merchant_id=123
# Would output the contents of
# ./repo/get/3/en/mobile/merchant/nearby/latitude=51.5073509&longitude=-0.127758&merchant_id=123.json
@Hais
Hais / index.php
Last active Aug 29, 2015
SlackShat
View index.php
<?php
/**
*
* To run:
*
* #1 change token
*
* #2 php -S localhost:8080 index.php
*