This file contains 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
// npm install jsdom | |
// present a random Aww jpg | |
// problem: /r/aww/random seems to update the URI on a timer, not per request | |
function aww_image(title, url, img){ | |
this.title = title; | |
this.url = url; | |
this.img = img; | |
} |
This file contains 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
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "Itinerary API" | |
}, | |
"host": "localhost", | |
"basePath": "/v1", | |
"produces": [ | |
"application/json" |
This file contains 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/bash -e | |
carthage $@ | |
CARTHAGE_BIN_CACHES_DIR=~/Library/Caches/org.carthage.CarthageKit/binaries | |
ZM_FRAMEWORKS=( $(ls -d $CARTHAGE_BIN_CACHES_DIR/zm*/*/*) ) | |
echo $ZM_FRAMEWORKS | |
DSYM_TARGET_DIR=`pwd`/Carthage/Build/iOS/ |
This file contains 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
#!/usr/bin/python | |
import sys | |
if __name__ == "__main__": | |
try: | |
print sum(map(int, sys.argv[1:])) | |
except: | |
print "Works only with integers" |
This file contains 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
#!/usr/bin/python | |
import sys | |
from operator import mul | |
if __name__ == "__main__": | |
try: | |
if len(sys.argv) > 1: | |
print reduce(mul, map(int, sys.argv[1:]), 1) | |
else: | |
print 0 |
This file contains 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
// Actual gzipping from https://github.com/1024jp/NSData-GZIP | |
// Example: ParameterEncoding.JSON.gzipped | |
infix operator • { associativity left } | |
func • <A, B, C>(f: B -> C, g: A -> B) -> A -> C { | |
return { x in f(g(x)) } | |
} | |
extension ParameterEncoding { |
This file contains 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
echo "************************" | |
echo "PRE ARCHIVE ACTION START" | |
echo "************************" | |
TARGET_DSYM=${DWARF_DSYM_FOLDER_PATH}/${PRODUCT_NAME}.app.dSYM | |
DWARF_DIR="Contents/Resources/DWARF" | |
for dSYM in "$DWARF_DSYM_FOLDER_PATH/"*.dSYM ; do | |
dSYM_NAME=`basename $dSYM` |
This file contains 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
// | |
// ListResult.swift | |
// | |
// Created by Tommaso Piazza on 23/02/16. | |
import Foundation | |
import Swiftz | |
This file contains 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
#!/usr/bin/env ruby | |
# Copyright (c) 2016 Tommaso Piazza | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
# and associated documentation files (the "Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of | |
# the Software. |
This file contains 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 | |
# Update: As of March 24th 2017 this script won't work. | |
# The script at https://get.haskellstack.org/ is broken | |
# because the binary of Stack 1.4 for ARM is missing from https://www.stackage.org/stack/ . | |
# You can still get the binary for Stack 1.3.2 from | |
# https://github.com/commercialhaskell/stack/releases/download/v1.3.2/stack-1.3.2-linux-arm.tar.gz | |
# and place it at $USR_LOCAL_BIN/stack in your system. | |
# Once Stack is installed you can proceed with the Install LLVM step |
OlderNewer