Skip to content

Instantly share code, notes, and snippets.

View justinokamoto's full-sized avatar

Justin justinokamoto

  • Amazon
  • Seattle, Washington
View GitHub Profile
@justinokamoto
justinokamoto / gist:7052c29d59291ae7fd9a
Created November 5, 2014 19:09
FOR ROY: List of possible semiprime house numbers (between 5579 and 10000), where both prime factors are equal distant from their neighbors, by a distance of 2 and 6.
import java.util.ArrayList;
public class Address_Primes {
private static ArrayList<Integer> possibilities = new ArrayList<Integer>();
private static int minimum = 5579; //Roy's address is bigger than 5579
public static boolean is_prime(int x){
for (int i = 2; i <= (Math.sqrt(x));i++){
if (x % i == 0){
return false;
@justinokamoto
justinokamoto / gist:9bbe8837081e1aa88041
Created November 5, 2014 19:32
Script for deploying iOS app to TestFlight with Xcode 6.1 & Xcode Server 4
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Valid and working as of 11/4/2014
# Xcode 6.1, XCode Server 4
#
API_TOKEN="<Your TestFlight API Token>"
(defun yank-to-clipboard ()
"Use ANSI OSC 52 escape sequence to attempt clipboard copy"
;; https://sunaku.github.io/tmux-yank-osc52.html
(interactive)
(let ((tmx_tty (concat "/dev/" (shell-command-to-string "ps l | grep 'tmux attach' | grep -v grep | awk '{print $11}'")))
(base64_text (base64-encode-string (encode-coding-string (substring-no-properties (nth 0 kill-ring)) 'utf-8) t)))
;; Check if inside TMUX
(if (getenv "TMUX")
(shell-command
(format "printf \"\033]52;c;%s\a\" > %s" base64_text tmx_tty))