Skip to content

Instantly share code, notes, and snippets.

@brianpartridge
brianpartridge / superbowl_squares.swift
Last active February 2, 2018 17:32 — forked from anonymous/superbowl_squares.swift
Superbowl Squares random number generator
import Foundation
/// http://stackoverflow.com/a/24029847/4992155
extension MutableCollection where Indices.Iterator.Element == Index {
/// Shuffles the contents of this collection.
mutating func shuffle() {
let c = count
guard c > 1 else { return }
for (unshuffledCount, firstUnshuffled) in zip(stride(from: c, to: 1, by: -1), indices) {
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password [download_directory]
require "mechanize"
class DasDownloader
attr_reader :agent, :email, :password, :output_dir
def initialize(email, password, output_dir)
@brianpartridge
brianpartridge / Create iOS Icons.jsx
Created September 23, 2012 00:20 — forked from twonjosh/Create iOS Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com