Skip to content

Instantly share code, notes, and snippets.

View poindextrose's full-sized avatar

Shawn Poindexter poindextrose

View GitHub Profile
@poindextrose
poindextrose / .profile_setjdk
Created January 22, 2015 16:49
Change JDK version on OS X
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
@poindextrose
poindextrose / gcloud-signed-url.js
Last active December 4, 2020 00:32
Example on how to create a signed URL using Node.js for uploading a file to Google Cloud Storage
var gcloud = require('gcloud');
var uuid = require('uuid');
// Google Cloud Storage Bucket Name
const BUCKET_NAME = 'bucket-name';
// Google Developer Console project ID
const PROJECT_ID = 'project-1234';
/* Google Developer Console -> API Manager -> Credentials ->
Add credentials -> Service account -> JSON -> Create */
const KEY_FILENAME = 'project-0d3d97832ca7.json' // relative path
@poindextrose
poindextrose / glcoud-signed-url.go
Last active January 22, 2024 22:59
Example on how to create a signed URL on Google Cloud Storage with Go
package main
import (
"fmt"
"time"
"google.golang.org/cloud/storage"
)
const (
@poindextrose
poindextrose / floatsign.sh
Last active November 25, 2015 16:46 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@poindextrose
poindextrose / .bashrc
Created October 13, 2016 19:35
launch tmux if connecting via ssh
# launch tmux if connecting via ssh
if command -v tmux>/dev/null; then
[[ ! -z $SSH_CONNECTION ]] && [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec sh -c 'tmux a || tmux'
fi
__author__ = 'Shawn Poindexter'
import sys
primes = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
prime_sum_table = [[(x + y) in primes for y in range(19)] for x in range(19)]
saved_solutions = {}