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 / 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 / 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 \
@fujin
fujin / blackout.md
Last active July 25, 2016 18:16
Blackout Super MiniH + FPV + Radio
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
[self.tableView setEditing:NO];
}];
moreAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
[self.tableView setEditing:NO];
}];
@benvium
benvium / installMobileProvisionFile.sh
Created May 1, 2012 15:14
This script installs a .mobileprovision file via bash (no GUI session needed)
#!/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)
#