Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@devishot
devishot / mini_magick#get_dominant_color.rb
Last active August 29, 2015 13:57
example of how to convert image to "-format %c histogram:info:" (http://www.imagemagick.org/Usage/files/#histogram) by gem "mini_magick". It used below to get dominant color of image by this solution for ImageMagick http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12033
require "mini_magick"
module MiniMagick
class Image
def get_dominant_color
color = run_command("convert", path, "-format", "%c\n", "-colors", 1, "-depth", 8, "histogram:info:").split(' ');
# color = " 1764000: (208,195,161) #D0C3A1 srgb(208,195,161)\n\n"
{
hex: color[2],
rgb: color[1][1..-2].split(',')
@tim-evans
tim-evans / document-title.js
Created February 19, 2015 20:39
Document Title component
import Ember from "ember";
export default Ember.Component.extend({
isVirtual: true,
tagName: '',
render: function (buffer) {
let titleTag = document.getElementsByTagName('title')[0];
this._morph = buffer.dom.appendMorph(titleTag);
this._super.apply(this, arguments);
}