Skip to content

Instantly share code, notes, and snippets.

View francois2metz's full-sized avatar

François de Metz francois2metz

View GitHub Profile
@matthiasbaldi
matthiasbaldi / revokeTraefik2Cert.sh
Created October 22, 2019 17:14
Traefik 2.0 revoke Let's Encrypt cerificate
#!/usr/bin/env bash
# credits: https://github.com/containous/traefik/issues/635#issuecomment-400423859
# usage: revokeCert.sh {yourDomainToRevoke}
# the JSON path changed a bit compared with Traefik v1
set -e
ACME_FILE=/traefik/path/traefik/acme.json # change
jq -r ".default.Certificates | .[] | select(.domain.main == \"$1\").key" < $ACME_FILE | base64 --decode > /tmp/a.key
@rustyio
rustyio / gist:4182514
Created December 1, 2012 14:16
Growing Startup Seeking A Well-Rounded Software Engineer

We are a new DC-area startup with Angel funding. Launched our prototype in April of this year; since then we've seen steady growth and happy, paying customers. (And we're already making waves among established players in the residential real estate industry.)

It's time to grow. We're looking to add a really good, well-rounded engineer to work alongside our CTO. (Rockstars, Code Ninjas, Ninjaneers, Ninjanerds, Silverbacks, and Brogrammers need not apply.) You'll be coding, of course, but you'll also need to think through design, architecture, and product-market fit, and take complete ownership of several key components of our system. In other words, be ready to wear many hats and change them on short notice.

More about us:

  • Co-founders have history of successful tech startups. (10+ years of startup experience each.)
  • Board of directors have deep knowledge of industry and lots of connections. (And a bunch of Ivy league degrees, FWIW.)
  • Heavily influenced by Hacker News culture and The Lean Startup.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jeffthink
jeffthink / index.html
Created January 18, 2012 03:31
Simple d3 Radar Chart
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Simple Radar Chart</title>
<link rel="stylesheet" href="style.css"/>
<script src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script src="radar.js"></script>
</head><body><h1>Simple Radar Chart</h1>
<div id="viz">
</div>
@iwinux
iwinux / gist:1529093
Created December 28, 2011 18:38
config.assets.precompile
def compile_asset?(path)
# ignores any filename that begins with '_' (e.g. sass partials)
# all other css/js/sass/image files are processed
if File.basename(path) =~ /^[^_].*\.\w+$/
puts "Compiling: #{path}"
true
else
puts "Ignoring: #{path}"
false
end
@tj
tj / app.js
Created December 17, 2011 23:15
express 3.x cookie session middleware example
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.use(cookieSessions('sid'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@francois2metz
francois2metz / indextank.js
Created June 13, 2011 16:48
indextank with Node and Spore
// mkdir indextank
// wget https://github.com/SPORE/api-description/blob/master/services/indextank.json
// install node and npm
// npm install spore underscore futures
// edit baseUrl, password and index var
// node indextank.js
var baseUrl = 'http://xxx.api.indextank.com';
var password = 'xxx';
var index = 'test_spore';
body = MultipartBody.new(:field1 => 'test', :field2 => 'test2')
http = EventMachine::HttpRequest.new('http://example.com').post(
:head => {'content-type' => "multipart/form-data; boundary=#{body.boundary}"},
:body => body.to_s
)
# Or with a file part included
part1 = Part.new('name', 'content', 'file.txt')