Skip to content

Instantly share code, notes, and snippets.

View mijoharas's full-sized avatar

Michael Hauser-Raspe mijoharas

View GitHub Profile
@mijoharas
mijoharas / heroku.txt
Created November 6, 2013 18:08
Heroku
heroku apps:create example
git push heroku master
PGUSER=michael heroku pg:push refinerytest_development DATABASE
heroku pg:reset
@mijoharas
mijoharas / README.md
Last active December 27, 2015 16:09 — forked from JoelBesada/README.md
Backtick command for is it down.

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@mijoharas
mijoharas / imagemagick.sh
Last active September 18, 2021 04:23
imagemagick
# convert with transparency
convert screenshot2.tiff -transparent '#112332' screenshot2.png
# convert with gaussian blur
convert forest.jpg -gaussian-blur 0x18 forest_blur.jpg
#shave 4 pixels off the top and bottom
convert screenshot4.png -shave 0x4 screenshot4_crop.png
# crop to square 422x422 with 0x0 offset
convert mike_gravatar.jpeg -crop 422x422+0+0 mike_gravatar_square.jpeg
# give circular alpha channel around it NOTE this is for a 422x422 image (note the 211x211)
convert mike_gravatar_square.jpeg \( +clone -threshold -1 -negate -fill white -draw "circle 211,211,211,0" \) -alpha off -compose copy_opacity -composite mike_gravatar_circle.png
@mijoharas
mijoharas / helper.rb
Created November 19, 2013 19:49
Ruby Helpers
def time(&block)
start = Time.now
p block.call
p "that took #{Time.now-start}"
end
@mijoharas
mijoharas / .emacs
Created December 2, 2013 22:57
emacs
; list the packages you want
; (setq package-list '(auto-complete
; auto-complete-clang
; auto-indent-mode
; evil
; flycheck
; magit
; molokai-theme
; org
; smex
@mijoharas
mijoharas / .zshrc
Created December 5, 2013 13:01
My zshrc
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
@mijoharas
mijoharas / README.md
Last active August 29, 2015 13:57 — forked from JoelBesada/README.md
OpenSpritz

This is a wrapper for the OpenSpritz bookmarklet from here

========================== This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

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

defmodule PuzzledPintScriptElixir do
HTTPotion.start
defp get_file_strings do
File.read! "/usr/share/dict/cracklib-small"
end
def list_of_urls do
base_string = "http://www.puzzledpint.com/puzzles/august-2015/semaphore/"
list_of_words = get_file_strings
list_of_lines = String.split(list_of_words, "\n", trim: true)