Skip to content

Instantly share code, notes, and snippets.

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

Simon Menke fd

🏳️‍🌈
Unstoppable
View GitHub Profile
let who = "Simon Menke";
let spec = ['age', 28];
let u = url`/hello/${who}/${spec}`;
// => "/hello/Simon%20Menke/age/28"
function url(tmpl, ...args) {
let len = tmpl.length-1;
let url = tmpl[0];
Verifying that +simonmenke is my openname (Bitcoin username). https://onename.io/simonmenke
@fd
fd / designer.html
Created June 26, 2014 14:41
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<polymer-element name="my-element">

Keybase proof

I hereby claim:

  • I am fd on github.
  • I am fd (https://keybase.io/fd) on keybase.
  • I have a public key whose fingerprint is FCAB 24E5 95D9 9F0D 497D B02C 11E7 0A16 D300 31C6

To claim this, I am signing this object:

var ModuleA = require('module-a');
var ModuleB = require('module-b');
var A = new ModuleA("A"),
B = new ModuleB("B");
A.foo() // => "foo"
A.bar() // => [error]
A.getName() // => "A"
@fd
fd / pq_with_schema_selector.go
Last active December 25, 2015 04:49
This is a wrapper for the `sql.Driver` in `github.com/lib/pq` which allows you to set the schema search path for each connection in the connection pool.
package postgres
import (
"database/sql"
"database/sql/driver"
"fmt"
"github.com/lib/pq"
"strings"
)
@fd
fd / gist:4731002
Last active December 12, 2015 06:39
Mr. Henry - Code Style document

Mr. Henry - Code Style document

=> YOU MUST FOLLOW THIS RULE.
=> YOU MUST NEVER, EVER DO THIS.

General

Variable names

✓ — Variable names should NEVER be acronims.

if Rails.env.staging?
FailtaleReporter.enabled = false
end
@fd
fd / glossary_regexp.rb
Created August 29, 2011 08:09
Glossary Regexp
description = file.description.clone
@glossary.each do |w|
terms = w.name.split(',')
terms.each do |term|
term = Regexp.escape(term.strip).gsub('\ ', '\s+')
description.gsub!(/(\b#{term}\b)/i, "<acronym rel=\"#{w.id}\">\\1</acronym>")
end
end
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
RVM_THEME_PROMPT_PREFIX="["
RVM_THEME_PROMPT_SUFFIX="]"
SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}'
SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}'
SCM_GIT_CHAR='${bold_green}±${normal}'
SCM_SVN_CHAR='${bold_cyan}⑆${normal}'