Skip to content

Instantly share code, notes, and snippets.

View fd's full-sized avatar
🏳️‍🌈
Unstoppable

Simon Menke fd

🏳️‍🌈
Unstoppable
View GitHub Profile
@fd
fd / sec.pem
Last active July 26, 2021 10:03
*-util[s] deploy info (master data is in my DropBox in ./build-sec)
-----BEGIN SEC BOX-----
Cm4KIPiuq0bSkuBK+g9gmOniB6V8pCo8hV+OALiV7vRcMKw4EhgpMqmFKu/EL4hT
hwlLFvFHKkUYpVPoveIaMFq1SLYfgmKP+2ubmY4eGLhKax8StioVF93KduPvCayH
4TBdNME8gXXC3o6OkbTuGgpuCiDUfRvY9cZb1CAD3xKkVMff8hD+nOP/aUkILS6k
YVeTVxIYNsnuclmYVuJLzHi+tI3t60PRvNPgBxtOGjDkj4u3+Mbz3OPidBjfbRp/
ZUO5JqWcAXdN+g6U4Wi7yEt3nkz8lQSccG5oPpuwFdUKbgog6/xaUyL7Q5t8k29i
HH5jjTACDmeKtTA2ho8SKzVqwjESGALW4tXH4f2FEvaoNwz9OdWl03Nl9YLf6Row
HUGnA73VzK5gEXpf3vYqh2gcHRks3OxMHfC0wNFB7k1ETGFRX60lcLX9idZLstW+
Cm4KIPO1Z8kKreuifNfkP1dMpjYZ9IAx7/gRnNblDrCh12duEhhtH8p4qClMF1G2
imzYgAehcBvszWBuxicaMICYLHTkf9Re1/QJhlIHOIShLppVQ3b83kvnyTgUk017
@yvesvanbroekhoven
yvesvanbroekhoven / release_version
Created October 22, 2013 07:38
Simple sofware version release incrementation script
#!/usr/bin/env bash
if ! [[ -a "VERSION" ]]; then
echo "VERSION file initialized"
touch "VERSION"
echo "0.0.0" > "VERSION"
fi
version=$(cat VERSION)
version_arr=(${version//./ })
@coffeemug
coffeemug / gist:6168031
Last active October 15, 2024 01:08
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@robertjwhitney
robertjwhitney / activeadmin_sortable.js.coffee
Created July 3, 2012 03:37
Simple drag/drop reordering of records in an ActiveAdmin view table
# http://stackoverflow.com/a/8936202
#
# ActiveAdmin already includes the necessary jquery in active_admin/base,
# so just add this to javascripts/active_admin.js after //= require active_admin/base
#
#
# Serialize and Sort
#
# model_name - you guessed it, the name of the model we are calling sort on.
# This is the actual variable name, no need to change it.
@chetan
chetan / yardoc_cheatsheet.md
Last active November 11, 2024 08:27
YARD cheatsheet
@blambeau
blambeau / destr.rb
Created November 22, 2011 09:00
Fun destructuring in Ruby 1.9
class Hash
def with(&block)
block.call *block.parameters.map{|x| self[x.last]}
end
end
# Example
h = {:name => "blambeau", :hobby => "ruby"}
@matpowel
matpowel / tableless.rb
Created July 23, 2011 10:04
An ActiveRecord emulating Tableless model which works with Rails 3.1
class Tableless < ActiveRecord::Base
def self.column(name, sql_type = nil, default = nil, null = true)
columns << ActiveRecord::ConnectionAdapters::Column.new( name.to_s, default, sql_type.to_s, null )
end
def self.columns()
@columns ||= [];
end
@yvesvanbroekhoven
yvesvanbroekhoven / gist:946066
Created April 28, 2011 09:14
check for dir path in Rails config files
case Etc.getpwuid(Process.uid).name
when 'your name'
# my config
when 'my name'
# my config
else
# everybody else
end
@fd
fd / jquery.viewport.js
Created September 30, 2010 14:55
jQuery plugin for getting elements above, in or below the viewport
(function($){
$.fn.viewportState = (function(){
var results = [];
this.each(function(){
var bounds = this.getBoundingClientRect();
if (window.viewport.height() < bounds.top) {
results.push(['below', $(this)]);
} else if (bounds.bottom <= 0) {
results.push(['above', $(this)]);
} else {