Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
# Show the current working branch...
gwb(){
git branch |\
sed -n '/\* /s///p'
}
# Show the current working branch stripped of pivitol id, and spaced
# (instead of dashed)
gwbstrip(){
git branch |\
(defun jasmine-coffee/verify-thing (pattern)
"Compose and launch a jasmine spec URL for the thing defined by PATTERN."
(let* ((start-column 0) (spec-string ""))
(save-excursion
(move-end-of-line 1)
(re-search-backward pattern)
(setq start-column (current-column))
(setq spec-string (match-string-no-properties 1))
(while
(re-search-backward jasmine-coffee/describe-regexp 0 t)
# OSX specific bash function to make icon pngs
# for Images.xcassets/AppIcon.appiconset
# (ie. Current XCode App icon method.)
function makeIconPngs(){
for size in 16 32 128 256 512
do
retina=$(( $size * 2 ))
sips -Z $size $1 --out icon_${size}x${size}.png
sips -Z $retina $1 --out icon_${size}x${size}@2x.png

App Checklist

  • Single page view,

    • shows text.
    • shows geometry (CGLayer / UIView)
    • shows image
  • Touch / gestures

    • drag some object around
  • tap it
@jasonm23
jasonm23 / sass-hex-color-to-var.el
Last active August 29, 2015 14:05
Find a hex color, and replace it with a newly created sass variable. (placed at the top of the buffer)
(defun sass-hex-color-to-var ()
"Find a hex color, and replace it with a newly created variable name.
The new variable definition is placed at the top of the buffer and
initialized with the hex color found.
It is named based on its css selector and the property being set.
If you repeat the function until it can't match any more color value.
You end up with a list of variables at the top of the buffer, which wil
mpages is an available package.
Status: Available from melpa -- [Install]
Version: 20140915.1338
Summary: An Emacs buffer for quickly writing your Morning Pages
A tool to quickly open a daily diary buffer.
Morning Pages are a concept named by Julia Cameron in her book
"The Artist's Way". They are defined by the activity of waking up every
list = ["searching for terms", "terms to search for", "search string contains", "terms", "kippers"]
words = "search term"
list.select{|s|
s.match Regexp.new("#{words.join('.*')}.*") or
s.match Regexp.new("#{words.reverse.join('.*')}.*")
}
(find-file (replace-regexp-in-string "/views/\\(.*\\)" "/view_models/\\1" (buffer-file-name)))
(setq jump-list
;;- name ------ path in -------- name match -------------------------------- name replacement ----
;; javascript/
;; airdrilling/
'(templates ("/templates/" "/templates/\\(.*\\)\\(\\.hamlc\\)" "/templates/\\1.hamlc")
view_models ("/view_models/" "/view_models/\\(.*\\)\\(\\.js.coffee\\)" "/view_models/\\1\\2")
views ("/views/" "/views/\\(.*\\)\\_view\\(\\.js.coffee\\)" "/views/\\1_view\\2")))
@jasonm23
jasonm23 / emacs-to-apps.sh
Created November 14, 2014 03:28
Move Homebrew Emacs-mac (Yamamoto Mitsuharu) to the /Applications/ folder, update the icon and re-cache
#!/bin/bash
# Locate the Emacs.app from brew installed emacs-mac
mv `brew info emacs-mac | grep -A1 "was installed to:" | tail -1`/Emacs.app /Applications/
# Grab the emacs-icons-project carmine card icon.
wget https://github.com/emacsfodder/emacs-icons-project/blob/master/emacs-card-carmine.icns\?raw\=true
# Move icon into place
mv emacs-card-carmine.icns\?raw\=true /Applications/Emacs.app/Contents/Resources/Emacs.icns
@jasonm23
jasonm23 / github-create-repo.sh
Last active August 29, 2015 14:09
Github create repo from the terminal. see comment for usage
github-create-repo() {
w="\033[37m\033[1m"
rst="\033[0m"
org_name=$1
repo_name=$2
__add_all(){
printf "${w}Adding all changes / new files to index and committing.${rst}\n"