Skip to content

Instantly share code, notes, and snippets.

View jeffnuss's full-sized avatar

Jeff Nuss jeffnuss

View GitHub Profile
@jeffnuss
jeffnuss / prime-factorization-example.py
Last active January 4, 2016 21:39
This is an example implementation of the RSA example on wikipedia: https://en.wikipedia.org/wiki/RSA_(algorithm)#A_worked_example.
# Choose two distinct prime numbers
p = 61
q = 53
# Compute n = pq
n = p * q
# Compute the totient of the product as φ(n) = (p − 1)(q − 1)
phi = (p - 1) * (q - 1)
# Increment the build number with every build.
BUILDNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
BUILDNUM=$(($BUILDNUM + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILDNUM" "${PROJECT_DIR}/${INFOPLIST_FILE}"
# This splits a two-decimal version string, such as "0.45.123", allowing us to increment the third position.
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")
NEWSUBVERSION=`echo $VERSIONNUM | awk -F "." '{print $3}'`
NEWSUBVERSION=$(($NEWSUBVERSION + 1))
NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'`
@jeffnuss
jeffnuss / app.coffee
Created February 10, 2013 18:25 — forked from jondot/app.coffee
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)