Skip to content

Instantly share code, notes, and snippets.

View erotte's full-sized avatar
🏡
Arbeit Arbeit Arbeit

Eckhard Rotte erotte

🏡
Arbeit Arbeit Arbeit
View GitHub Profile
@2called-chaos
2called-chaos / install_nginx_vim.sh
Created March 3, 2013 01:03
enable nginx vim syntax highlighting (on Ubuntu/Debian)
#!/bin/sh
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394
mv download_script.php\?src_id\=19394 nginx.vim
cat > ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
EOF
<msch> RhodiumToad: so the simple advice is, "always use timestamptz, never timestamp"?
<RhodiumToad> when storing a future time, the way to decide is this:
<RhodiumToad> there are a few apps where timestamp without time zone has its uses.
<RhodiumToad> e.g. things like calendaring / scheduling which are dealing mostly in future times
<RhodiumToad> does it matter how many seconds/minutes/hours there are between now and then,
<RhodiumToad> or does it matter what the clock on the wall will read then
<RhodiumToad> in the first case you need timestamptz, in the second case, timestamp without time zone,
<RhodiumToad> possibly with a separate field (possibly in some other table) storing the timezone name
<RhodiumToad> otherwise, you run into the same problem that many calendaring apps did when the US DST rules were changed
@mysteriouspants
mysteriouspants / 000-README.md
Created November 7, 2012 17:08
HAML vs ERB vs SLIM on JRuby 1.7.0 Showdown!

Section of Introductions

This was all done on a rather nice iMac:

  • Intel Core i7 Sandy-Bridge 4-core chip
  • 12 GB of RAM
  • 1TB Spinning-disk hard drive
  • java version 1.6.0_37, build 1.6.0_37-b06-434-11M3909 "HotSpot" 64-bit VM "mixed mode" (whatever that's supposed to mean)
  • The excellent pre-chewed testing app at
@erotte
erotte / gitcal.rb
Created May 18, 2012 22:38
Simple ruby script for creating ical calendars from local git repos
#! /usr/bin/env ruby
# gitcal.rb
# creates an .ics file from a local git repository and loads it into iCal.app
# Usage: `[bundle exec] ruby gitcal.rb [repo_path] [branch] [count_back]`
# A shell wrapper script maybe a good idea, but for me this works as it is.
require 'grit' # https://github.com/mojombo/grit
require 'ri_cal' # https://github.com/rubyredrick/ri_cal
@dennisreimann
dennisreimann / manifesto.md
Created April 23, 2012 18:42 — forked from hmans/whatever-manifesto.md
The Manifesto

THE MANIFESTO

Whatever it is that you choose to do, follow these two simple rules:

  1. Be friendly.
  2. Have fun.
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@felquis
felquis / IEImageRotate.js
Created March 8, 2012 20:55
Faz uns calculos para aplicar o Matrix e rotacionar elementos no Internet Explorer
// 08/03/2012, 16:59 - ICOMP
// Simple Rotate Elements in IE
// by @felquis
// Thanks for Lucio, Etiqueta
window.globalVars = {rotatePI : Math.PI * 2 / 360};
$(window).load(function(){
$('[data-rotate]').each(function(i, obj){
// Valor do deg
var $obj = $(obj),
rotate = $obj.css('transform').replace(/rotate\((\-?[0-9]{1,})deg\)/i, '$1'),
@rn0
rn0 / README.markdown
Created February 20, 2012 00:22 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is an extension to Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@sos4nt
sos4nt / gist:1363753
Last active September 28, 2015 01:38
Using ruby-debug19 with Ruby 1.9.3, RVM and Bundler
#!/bin/bash
# Run using: bash <(curl -s https://raw.github.com/gist/1363753)
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p0/
rm linecache19-0.5.13.gem
rm ruby-debug-base19-0.11.26.gem
bundle update ruby-debug19