This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=frame-nopass.pdf -c .setpdfwrite -f frame.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Extracts email addresses from one or more plain text files. | |
# | |
# Notes: | |
# - Does not save to file (pipe the output to a file if you want it saved). | |
# - Does not check for duplicates (which can easily be done in the terminal). | |
# | |
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Public domain. | |
// Free to use. | |
// Use like this: | |
var world = "Hello, world!" | |
let convertedRange = world.convertRange(0..<5) | |
world.removeRange(convertedRange) | |
// Converts a regular range (0..5) to a proper String.Index range. | |
extension String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import UIKit | |
// Setup the calendar object | |
let calendar = NSCalendar.currentCalendar() | |
// Set up date object | |
let date = NSDate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fizzbuzz(i: Int) -> String { | |
let result = (i % 3, i % 5) | |
switch result { | |
case (0, _): | |
return "Fizz" | |
case (_, 0): | |
return "Buzz" | |
case (0, 0): | |
return "FizzBuzz" | |
default: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Queue.swift | |
// NTBSwift | |
// | |
// Created by Kåre Morstøl on 11/07/14. | |
// | |
// Using the "Two-Lock Concurrent Queue Algorithm" from http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html#tlq, without the locks. | |
// should be an inner class of Queue, but inner classes and generics crash the compiler, SourceKit (repeatedly) and occasionally XCode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// pggrep - updated 12/4/15 | |
// Created by Erica Sadun on 6/17/15. | |
// Copyright © 2015 Erica Sadun. All rights reserved. | |
// | |
import Foundation | |
extension String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* json_storage.js | |
* @danott | |
* 26 APR 2011 | |
* | |
* Building on a thread from Stack Overflow, override localStorage and sessionStorage's | |
* getter and setter functions to allow for storing objects and arrays. | |
* | |
* Original thread: | |
* http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage | |
* |