Skip to content

Instantly share code, notes, and snippets.

View rlespinasse's full-sized avatar

Romain Lespinasse rlespinasse

View GitHub Profile
@obazoud
obazoud / style.css
Created October 26, 2013 15:27
voyages-sncf.com - stylish
#breadcrumb {
display:none;
}
#header {
display:none;
}
#pre-header {
display:none;
}
@artyom
artyom / rpc-tls-client.go
Last active October 9, 2023 15:44
Go RPC over TLS.You have to create the following keys: certs/client.crt, certs/client.key, certs/server.crt, certs/server.key. client.crt and server.crt should be signed with ca.crt, which should be concatenated to both client.crt and server.crt. It's easier to do with easy-rsa: http://openvpn.net/index.php/open-source/documentation/howto.html#pki
package main
import (
"crypto/tls"
"crypto/x509"
"log"
"net/rpc"
)
func main() {
@Pallinder
Pallinder / .bash_profile
Created September 3, 2013 17:29
Getting golang + mac os x + gdb to play nicely
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@k33g
k33g / main.golo.md
Last active December 15, 2015 08:29
Display colored messages in the terminal
module main

import rainbow

function main = |args| {
	console():
		green():print("Hello "): 
		red():println("World !!!"):
 yellow():print("Salut "):blue():println("à tous ..."):
@k33g
k33g / elmira.golo
Last active December 15, 2015 08:18
Elmira : some tests with golo
module elmira
import java.util.HashMap
import java.util.Arrays
import java.util.LinkedList
function test = -> DynamicObject()
function Elmira = -> DynamicObject():
@k33g
k33g / glloq.golo
Last active December 14, 2015 16:59
le "Glloq", 1er DSL pour enfants en Golo
module glloq
function boite = -> DynamicObject():
op(""):
value(0):
nbCailloux(0):
nbAllumettes(0):
define("alumette", |this| {
if this: op(): equals("+") { this: nbAllumettes(this: nbAllumettes() + this: value())}
if this: op(): equals("-") { this: nbAllumettes(this: nbAllumettes() - this: value())}
@fcamblor
fcamblor / late-amend.sh
Last active December 14, 2015 16:38
This bash script will allow you to make a "late amend" of a commit (not the latest) in your git history
#!/bin/bash
targetSha1=$1
currentSha1=`git rev-parse HEAD`
previousSha1=`git rev-parse HEAD^`
currentBranchName=`git rev-parse --abbrev-ref HEAD`
sha1ToApply=
if [ "" == "$1" ]
then
@dgageot
dgageot / SEOFilter.java
Created February 15, 2013 14:27
Jersey Filter *Prototype* that uses PhantomJS to retrieve pages asked by Googlebot. This way the javascript is interpreted by phantomjs and it provides a static webpage to Google.
package main;
import com.google.common.base.Strings;
import com.google.common.io.ByteStreams;
import com.sun.jersey.spi.container.ContainerRequest;
import com.sun.jersey.spi.container.ContainerResponse;
import com.sun.jersey.spi.container.ContainerResponseFilter;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@dgageot
dgageot / CodeStoryStatusTest.java
Last active November 4, 2021 10:20
FluentLenium, PhantomJs, GhostDriver
package net.gageot;
import org.junit.Test;
import static org.fest.assertions.Assertions.assertThat;
public class CodeStoryStatusTest extends PhantomJsTest {
@Override
public String defaultUrl() {
return "http://status.code-story.net";