Skip to content

Instantly share code, notes, and snippets.

View rothmichaels's full-sized avatar

Roth Michaels rothmichaels

View GitHub Profile
@rothmichaels
rothmichaels / GPL.md
Created March 22, 2013 19:31 — forked from jnrbsn/GPL.md

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@rothmichaels
rothmichaels / EPL-v1.0.md
Last active December 15, 2015 10:39
Eclipse Public License - v 1.0 in markdown

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

"Contribution" means:

    in the case of the initial Contributor, the initial code and documentation distributed under
@rothmichaels
rothmichaels / term-fix.el
Created October 7, 2015 01:15
Fix CDPATH error in term/ansi-term moode
(defun term-emulate-terminal (proc str)
(with-current-buffer (process-buffer proc)
(let* ((i 0) char funny
count ; number of decoded chars in substring
count-bytes ; number of bytes
decoded-substring
save-point save-marker old-point temp win
(buffer-undo-list t)
(selected (selected-window))
@rothmichaels
rothmichaels / emacs-bash.sh
Last active December 14, 2015 06:51
Bash sourcing profile/.profile for non-login shells on OS X
#!/usr/bin/env bash
# Place this file in your PATH and
# add the following line to your .emacs.el:
# (setq explicit-shell-file-name "emacs-bash.sh")
bash --init-file <(echo 'source /etc/profile; source ~/.profile')
@rothmichaels
rothmichaels / .sbtconfig
Last active December 12, 2015 05:43 — forked from agleyzer/gist:7758128
my ~/.sbtconfig, works w/ SBT 0.13 and ansi-term
SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M"
# this allows sbt to be executed in Emacs terminal
if [[ -n $EMACS ]]; then
echo "Emacs detected, commencing hijacking sequence..."
# to avoid division by zero, with jline 1.0, see https://github.com/sbt/sbt/issues/714
stty columns 80
# avoid fancy colors that comint-mode won't support anyway
@rothmichaels
rothmichaels / GenericExample-MagicValue.swift
Last active November 12, 2015 14:36
Getting the Type from a generic
func magicValue<T>() -> T? {
let type = T.self
switch type {
case _ where type == String.self:
return "hello, world" as? T
case _ where type == Int.self:
// Ask for a number and get the answer to life, the universe, and everything
return 42 as? T
default:
return nil
@rothmichaels
rothmichaels / Create iOS Icons.jsx
Last active May 24, 2016 20:26 — 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
@rothmichaels
rothmichaels / *scratch*.el
Last active May 17, 2016 20:53
In progress emacs shell-script-mode settings
(setq sh-basic-offset 2 sh-indentation 2)
(setq sh-indent-for-case-label 0)
(setq sh-indent-for-case-alt '+)
@rothmichaels
rothmichaels / TableViewDataSourceExample.swift
Last active October 4, 2022 11:20
Enumerated UITableViewCell identifier example
import UIKit
/// Protocol to be implemented by table view cell identifier enums
protocol TableViewCellIdentifier {
var identifierString: String { get }
}
/// Extension to provide default impementation for RawRepresentable String enums
extension TableViewCellIdentifier where Self: RawRepresentable, Self.RawValue == String {
var identifierString: String {
@rothmichaels
rothmichaels / .gnus.el
Last active July 29, 2016 22:14
Gnus Configuration
(setq user-full-name "Roth Michaels"
user-mail-address "roth@rothmichaels.us")
(setq my-email-addresses '("roth@rothmichaels.us"
"roth@wasabihut.com"
"roth@myble.net"
"roth@sohoko.io"))
(setq message-alternative-emails (regexp-opt my-email-addresses))