Skip to content

Instantly share code, notes, and snippets.

View masukomi's full-sized avatar

masukomi (a.k.a. Kay Rhodes) masukomi

View GitHub Profile
#!/bin/sh
#installs ncurses 6.0 on os x
curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
tar -xzvf ncurses-6.0.tar.gz
cd ./ncurses-6.0
./configure --prefix=/usr/local \
--without-cxx --without-cxx-binding --without-ada --without-progs --without-curses-h \
--with-shared --without-debug \

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@masukomi
masukomi / git_push_without_checkout.txt
Last active August 29, 2015 14:03
attempting to push to a git repo without doing a checkout
# first create a bare repo
git init --bare test_origin.git
# now create a repo that will push to it
git init test_1
Initialized empty Git repository in /Users/masukomi/workspace/temp/test_1/.git/
;;;; pretty-literals.lisp - pretty hash table & vector literal syntax
;;;; inspired by and uses code from http://frank.kank.net/essays/hash.html
(in-package #:pretty-literals)
;; vector literal syntax using brackets
(set-macro-character #\[
(lambda (str char)
(declare (ignore char))
(let ((*readtable* (copy-readtable *readtable* nil))
@masukomi
masukomi / application.js
Last active August 29, 2015 14:26 — forked from aackerman/application.js
Preventing multiple electron application instances
var net = require('net');
var fs = require('fs');
var os = require('os');
var path = require('path');
// Create server to listen for additional application launches
function listenForNewProcesses(socketPath) {
// create a server for listening on the socket path
var server = net.createServer(function(connection) {
connection.on('data', function(data) {
//twtplus
//Forked from: http://sites.google.com/site/coosgadgets/2ii
//Cleared out hacks, refactored code
//Additional features:
//*Shorten all urls in a post
//*d message with friend username autocompletion
//*Post as specified user using "as" modifier
//Visit for more explanation: http://damienh.org/2009/03/02/twtplus-the-missing-twitter-command-for-ubiquity-and-firefox/
twitter_template = "\
public class MyAction extends ActionSupport implements TemplateMethodModel {
/*Your functionality here */
/**
* when you need to display a localized piece of text in
* the ftl just use ${text("some.property.name")}
* there should be a package.properties or ClassName.properties
* file in the same source package directory as the Action that
* will be using them. There *is* a way to set a global properties file
@masukomi
masukomi / git_shell_prompt.sh
Created June 23, 2011 14:07
Modified prompt displaying current git branch and radiation symbol if the branch is dirty
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo -e " \xE2\x98\xA2"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
}
export PS1='\[\033[01;32m\]\w $(git branch &>/dev/null; if [ $? -eq 0 ];
then echo "\[\033[01;34m\]$(parse_git_branch)"; fi) \$ \[\033[00m\]'
@masukomi
masukomi / open_in_marked.sh
Created December 3, 2011 18:15
opening Markdown files in Marked
# add the following to your ~/.bashrc to open any markdown file in Marked
# usage: marked my_markdown_file.md
# this will work the next time you launch a terminal or refresh your shell.
function marked {
open -a Marked $1
}
@masukomi
masukomi / gist:1451438
Created December 9, 2011 12:59
bundle show all (for bundlr)
# I wanted a way to combine bundle list with bundle show so that i could show
# the location of all the gems bundlr was managing.
# this does it (at least on unix / OS X )
# The first line is always an error message from bundlr because the first line of
# bundle list's output is "Gems included by the bundle:" which, obviously
# isn't a valid gem name.
bundle list | perl -pi -e 's/\s+\*\s(\S+)\s+.*/$1/' | while read line ; do bundle show $line ; done