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 / golang-json-marshall
Created October 5, 2015 17:25 — forked from kendellfab/golang-json-marshall
Handling custom Json marshalling in golang.
type Whatever struct {
someField int
}
func (w Whatever) MarshalJSON() ([]byte, error) {
return json.Marshal(struct{
SomeField int `json:"some_field"`
}{
SomeField: w.someField,
})
@JonathanPorta
JonathanPorta / gist:001fd6ec328847dca227
Last active August 29, 2015 14:26
Trying to get Windows Update to Download the Windows 10 Upgrade
# This didn't work.
Jonathan Porta@PORTAJ-GAMETOP C:\Users\Jonathan Porta
$ net stop wuauserv
The Windows Update service is stopping.
The Windows Update service was stopped successfully.
Jonathan Porta@PORTAJ-GAMETOP C:\Users\Jonathan Porta
$ rd /s /q C:\Windows\SoftwareDistribution
C:\Windows\SoftwareDistribution\Download\8F36B3~1\BITB8C4.tmp - The operation completed successfully.
@JonathanPorta
JonathanPorta / setpin.sh
Last active January 4, 2021 13:32
Change Yubikey PIN/PUK
#!/bin/bash
set -e # bail on errors
# Make sure your shell history isn't saved
hsback=$HISTFILE
unset HISTFILE
echo "Enter you current PIN - leave blank if default:"
read oldpin
@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!"
@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 / 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 / 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 / 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 / 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
#!/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)
#