Skip to content

Instantly share code, notes, and snippets.

View kogakure's full-sized avatar
🏠
Working from home

Stefan Imhoff kogakure

🏠
Working from home
View GitHub Profile
@kogakure
kogakure / gist:5108139
Last active December 14, 2015 15:29
CSS: Flex box
<div class="grid">
<div class="col fluid">
<h2>Fluid</h2>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</div>
<div class="col fixed">
<h2>Fixed</h2>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</div>
<div class="col fluid">
@kogakure
kogakure / gist:5003206
Created February 21, 2013 08:31
PERL: Load Gravatar images of all commiters of a Git repository into .git/avatars. This is useful for gource.
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use Thread::Pool::Simple;
@kogakure
kogakure / gist:4769950
Created February 12, 2013 13:41
SASS: Triangle Mixin
@mixin triangle($width, $dir, $color) {
@if $dir == up {
width: 0;
height: 0;
border-left: $width/2 solid transparent;
border-right: $width/2 solid transparent;
border-bottom: $width/2 solid $color;
} @else if $dir == down {
width: 0;
height: 0;
@kogakure
kogakure / gist:4769904
Created February 12, 2013 13:31
SASS: Circle Mixin
@mixin circle($width, $color) {
width: $width;
height: $width;
background: $color;
-webkit-border-radius: $width/2;
-moz-border-radius: $width/2;
border-radius: $width/2;
}
.circle {
@kogakure
kogakure / gist:4030985
Created November 7, 2012 11:37
CSS: Prevent Superscripts and Subscripts from Affecting Line-Height
/* http://css-tricks.com/snippets/css/prevent-superscripts-and-subscripts-from-affecting-line-height/ */
sup, sub {
vertical-align: baseline;
position: relative;
top: -0.4em;
}
sub { top: 0.4em; }
@kogakure
kogakure / .vimrc
Created October 4, 2012 13:25
Vim: Extended Text Motions
" Extended Text Motions
" http://connermcd.com/blog/2012/10/01/extending-vim%27s-text-objects/
let pairs = { ":" : ":",
\ "." : ".",
\ "<bar>" : "<bar>",
\ "*" : "*" }
for [key, value] in items(pairs)
exe "nnoremap ci".key." T".key."ct".value
exe "nnoremap ca".key." F".key."cf".value
@kogakure
kogakure / gist:3783059
Created September 25, 2012 16:47
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@kogakure
kogakure / gist:3187467
Created July 27, 2012 11:21 — forked from edennis/gist:3187189
Ruby: Colorized irb prompt for production: ~/.irbrc
# .irbrc
if defined?(Rails) && Rails.production?
conf = IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]]
red = "\033[0;31m"
reset = "\033[0m"
[:PROMPT_S, :PROMPT_C].each do |p|
conf[p].gsub!(/^(.*)$/, "#{red}\\1#{reset}")
end
conf[:PROMPT_I] = "#{red}%N(%m):%03n:%i (PRODUCTION) > #{reset}"
end
@kogakure
kogakure / gist:3186691
Created July 27, 2012 07:43
AppleScript: Evernote - Empty Tag Remover
(*
http://veritrope.com
Evernote -- Empty Tag Remover
Version 1.0
December 22, 2010
Project Status, Latest Updates, and Comments Collected at:
http://veritrope.com/code/evernote-empty-tag-remover
*)
property unusedTags : {}
@kogakure
kogakure / gist:3052652
Created July 5, 2012 09:39
Shell: Dump a PostgreSQL database
/usr/local/pgsql/bin/pg_dump db_name -U db_user > dump_file_name.sql