Skip to content

Instantly share code, notes, and snippets.

View TJRoger's full-sized avatar
🎯
Focusing

Roger TJRoger

🎯
Focusing
View GitHub Profile
@TJRoger
TJRoger / xcode-build-number-generator.sh
Last active May 23, 2022 11:24 — forked from daegren/xcode-build-number-generator.sh
Script to automatically set the build number to the date
#!/bin/sh
# xcode-build-number-generator.sh
# @desc Automaticvally create build number every time using curent day, month and year
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
import UIKit
import AVFoundation
import AVKit
class ViewController: UIViewController, AVPlayerViewControllerDelegate {
var playerController : AVPlayerViewController!
override func viewDidLoad() {
super.viewDidLoad()
@TJRoger
TJRoger / TupleToArray.swift
Created July 4, 2020 09:30 — forked from emctague/TupleToArray.swift
Tuple to Array Conversion for Swift
/**
# Tuple-to-array for Swift
By Ethan McTague - January 28, 2020
This source code is in the public domain.
## Example
To convert a tuple of Ints into an array of ints:
@TJRoger
TJRoger / gist:d4be65e874404ae53acaf020387c8762
Created February 26, 2020 00:26 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@TJRoger
TJRoger / GLSL-Noise.md
Created November 10, 2017 06:49 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@TJRoger
TJRoger / gist:c62b5dfb6865ab66ea03
Created December 21, 2015 23:24 — forked from thinkphp/gist:1448754
Binary Search Tree Implementation in PHP
<?php
/**
* by Adrian Statescu <adrian@thinkphp.ro>
* Twitter: @thinkphp
* G+ : http://gplus.to/thinkphp
* MIT Style License
*/
@TJRoger
TJRoger / openssl-build.sh
Created December 8, 2015 15:26 — forked from felix-schwarz/openssl-build.sh
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
#!/bin/bash
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# https://gist.github.com/foozmeat/5154962
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz.