Skip to content

Instantly share code, notes, and snippets.

View alessandrostone's full-sized avatar

Alessandro Aresta alessandrostone

View GitHub Profile
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@alessandrostone
alessandrostone / ramdisk.sh
Last active August 29, 2015 14:16 — forked from rxin/ramdisk.sh
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
//
// NSObject+setValuesForKeysWithJSONDictionary.h
//
// Created by Tom Harrington on 12/29/11.
// Tweaked by Mark Dalrymple
//
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@alessandrostone
alessandrostone / color.m
Last active August 29, 2015 14:23 — forked from kylefox/color.m
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
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
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@alessandrostone
alessandrostone / fix_xcode_plugins
Last active August 29, 2015 14:25 — forked from bradley219/fix_xcode_plugins
Fix Xcode Plugin UUIDs
#!/bin/bash
UUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
echo "UUID=$UUID"
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add "$UUID"
@alessandrostone
alessandrostone / circlefifths.swift
Last active September 5, 2015 02:30 — forked from sketchytech/circlefifths.swift
Circle of Fifths in Swift: Notes for Key
// randomly thinking about how you might use circle of fifths to return notes in any given musical Key
enum KeySignature:String {
case A, B, C, CSharp = "C♯",D, E, F, G, AFlat = "A♭", BFlat = "B♭", CFlat = "C♭", DFlat = "D♭", EFlat = "E♭", GFlat = "G♭", Am, Bm, Cm, Dm, Em, Fm, Gm, FSharpm = "F♯m", CSharpm = "C♯m", GSharpm = "G♯m", EFlatm = "E♭m", BFlatm = "B♭m", AFlatm = "A♭m", ASharpm = "A♯m"
func major() -> KeySignature {
switch self {
case Am:
return KeySignature.C
case Em:
return KeySignature.G
case Bm:
enum Sharp: Int { case C = 0, G, D, A, E, B, F }
func sKeyForNote(n: Sharp) -> [Sharp] {
return (0..<n.rawValue)
.map{ n in (n + 6) % 7 }
.flatMap(Sharp.init)
}
enum Flat: Int { case F = 1, B, E, A, D, G }