Skip to content

Instantly share code, notes, and snippets.

View JonathanPorta's full-sized avatar
🎯
Focusing

Jonathan Porta JonathanPorta

🎯
Focusing
View GitHub Profile
@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)
#
- (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];
}];
@fujin
fujin / blackout.md
Last active July 25, 2016 18:16
Blackout Super MiniH + FPV + Radio
@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: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 / 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 / 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,
})
@dddnuts
dddnuts / Fastfile
Created June 4, 2016 10:39
Build ipa from Unity project with fastlane
fastlane_version "1.94.0"
default_platform :ios
platform :ios do
desc "Run Unity Editor tests"
lane :test_unit do
unity(
run_editor_tests: true
)
@ddrpa
ddrpa / UseXboxOneControlleronFedora.md
Created November 14, 2016 15:02
Use Xbox One Controller on Fedora
dnf search kernel-modules-extra
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active June 21, 2024 14:47
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se