Skip to content

Instantly share code, notes, and snippets.

View JonathanPorta's full-sized avatar
🎯
Focusing

Jonathan Porta JonathanPorta

🎯
Focusing
View GitHub Profile
@JonathanPorta
JonathanPorta / gist:e1adc7962504d3f965a6
Last active August 29, 2015 14:07
Swift Net custom headers usage example
init(hostname: String, accessToken: String) {
self.hostname = hostname
self.request = Net(baseUrlString: self.hostname, headers: ["access_token": accessToken])
}
func getActivities(callback: Callback) -> Void {
self.request.GET("/activities.json", params: nil, successHandler: { responseData in
var json = JSON(data: responseData.data)
callback(json)
}, failureHandler: { error in
FROM fedora:20
RUN yum install wget make bzip2 --assumeyes
# Download and build chruby
RUN wget -O /tmp/chruby-0.3.8.tar.gz https://github.com/postmodern/chruby/archive/v0.3.8.tar.gz
RUN tar -xzf /tmp/chruby-0.3.8.tar.gz -C /tmp/
RUN /bin/make -C /tmp/chruby-0.3.8/ install
RUN echo 'source /usr/local/share/chruby/chruby.sh' >> $HOME/.bashrc
@JonathanPorta
JonathanPorta / gist:fb2d07c6a7869e0bba37
Created October 29, 2014 22:59
ES6, Typescript and AtScript
ES6 is JS Next.
Typescript adds compile time static type assertions, and optionally runtime dynamic assertions.
AtScript adds compile time annotations to Typescript.
At(Type(ES6(JS)))
#!/bin/sh
# 2012 - Ben Clayton (benvium). Calvium Ltd
# Found at https://gist.github.com/2568707
#
# This script installs a .mobileprovision file without using Xcode. Unlike Xcode, it'll
# work over SSH.
#
# Requires Mac OS X (I'm using 10.7 and Xcode 4.3.2)
#
@JonathanPorta
JonathanPorta / dump of everything downloaded
Last active August 29, 2015 14:11
Tried every install argument combination suggested in the 13 page long forum post here: http://facepunch.com/showthread.php?t=1414775&page=13
[portaj@portaj-air steam]$ find ./install
./install
./install/exp_rust_linux
./install/exp_rust_linux/e8618f5c68cd68d6261d70d8be8661a18c11ebae
./install/exp_rust_linux/e8618f5c68cd68d6261d70d8be8661a18c11ebae/temp
./install/exp_rust_linux/e8618f5c68cd68d6261d70d8be8661a18c11ebae/appmanifest_258550.acf
./install/exp_rust_linux/e8618f5c68cd68d6261d70d8be8661a18c11ebae/downloading
./install/exp_rust_linux/EmptySteamDepot
./install/exp_rust_macos
./install/dev_rust_linux
@JonathanPorta
JonathanPorta / gist:2bdf39d59c9bf75e61f9
Last active November 21, 2017 20:47
How to figure out if a steam app has an update available
Great Example: https://github.com/dgibbs64/linuxgsm/blob/b8312d1160271e4a36a0edada3fa11ba9b5e2cdb/functions/fn_update_check#L109-L127
Steamcmd: steamcmd.exe +login anonymous +app_info_print 258550 +quit
Some potentially helpful thingys:
https://github.com/Philipp15b/go-steamapi
https://github.com/Philipp15b/go-steam
https://steamdb.info/app/740/history/
https://steamdb.info/api/GetRawDepots/?appid=740
@JonathanPorta
JonathanPorta / build.sh
Last active August 29, 2015 14:19
Unity3D Build Script
#! /bin/sh
# Example build script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build
# Change this the name of your project. This will be the name of the final executables as well.
project="ci-build"
echo "Attempting to build $project for Windows"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
@JonathanPorta
JonathanPorta / install.sh
Last active June 12, 2019 20:14
Unity3D CI Install Script
#! /bin/sh
# Example install script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build
# This link changes from time to time. I haven't found a reliable hosted installer package for doing regular
# installs like this. You will probably need to grab a current link from: http://unity3d.com/get-unity/download/archive
echo 'Downloading from http://netstorage.unity3d.com/unity/3757309da7e7/MacEditorInstaller/Unity-5.2.2f1.pkg: '
curl -o Unity.pkg http://netstorage.unity3d.com/unity/3757309da7e7/MacEditorInstaller/Unity-5.2.2f1.pkg
echo 'Installing Unity.pkg'
@JonathanPorta
JonathanPorta / .travis.yml
Created April 17, 2015 23:37
Unity3D Travis-CI Config Example
# Example Travis config. See the entire example: https://github.com/JonathanPorta/ci-build
language: objective-c
osx_image: xcode61
rvm:
- 2.1.2
install:
- ./Scripts/install.sh
script:
- ./Scripts/build.sh
@JonathanPorta
JonathanPorta / gist:730a9c9d1265fb5b2dd6
Created May 3, 2015 12:45
Rescue Exception in Ruby is not a good idea.
Snippet from: http://stackoverflow.com/questions/10048173/why-is-it-bad-style-to-rescue-exception-e-in-ruby?lq=1
Rescuing Exception will resuce all types of exceptions, including signals.
loop do
begin
sleep 1
eval "djsakru3924r9eiuorwju3498 += 5u84fior8u8t4ruyf8ihiure"
rescue Exception
puts "I refuse to fail or be stopped!"