Skip to content

Instantly share code, notes, and snippets.

View foliea's full-sized avatar

Adrien Folie foliea

  • Paris, France
View GitHub Profile
@foliea
foliea / keybase.md
Created October 6, 2017 06:16
Keybase proof

Keybase proof

I hereby claim:

  • I am foliea on github.
  • I am foliea (https://keybase.io/foliea) on keybase.
  • I have a public key ASB1vTkkkGbHy_0HV1UgdHXvBAKkWzQA-ElWd1WlybpgJAo

To claim this, I am signing this object:

@foliea
foliea / mail_helpers.rb
Last active January 21, 2016 14:31
Helpers
module MailDeliveries
extend self
extend Forwardable
@@deliveries = ActionMailer::Base.deliveries
def_delegators :@@deliveries, :last, :clear, :empty?
end
return _.mapValues({ca:'', cert:'', key:''}, (_value, cert) => {
let filepath = path.resolve(certPath, `${cert}.pem`);
return fs.readFileSync(filepath);
});
DockerProxy.prototype.hijack = function(req, clientSocket) {
this.client({
method: req.method,
uri: this.host+req.url
})
.on('socket', function(dockerSocket) {
dockerSocket.pipe(clientSocket);
.pipe(dockerSocket);
});
}
def stream(socket)
curl = Curl::Easy.new(url)
curl.on_body { |data| socket.write(data) }
curl.on_header { |data| socket.write(data) }
curl.multipart_form_post = true
curl.http_post
end
class ContainersController < DockerController
%w(
/json
/:id/json
/:id/top
/:id/changes
).each do |route|
get route do
reroute_to_docker
end
@foliea
foliea / nginx.conf.mustache
Last active August 29, 2015 14:17
Example
events {
worker_connections ${WORKERS:-1024};
}
http {
{{#config.websocket.on}}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
@foliea
foliea / Dockerfile.csharp
Last active August 29, 2015 14:16
csharp
FROM ubuntu:14.04
RUN apt-get update -qq && \
apt-get -qy install \
mono-mcs
ENV FILE prog.cs
ENV EXEC mcs $FILE && mono prog.exe
ENV DEV /home/dev
if (game.mode == "intro") {
if (game.panTo(700)) {
game.mode = "load-next-hero";
}
}
if (game.mode == "wait-for-firing") {
if (mouse.dragging) {
if (game.mouseOnCurrentHero()){
game.mode = "firing";
game.backgroundMusic = loader.loadSound('audio/gurdonark-kindergarten');
game.slingshotReleasedSound = loader.loadSound("audio/released");
game.bounceSound = loader.loadSound('audio/bounce');
game.breakSound = {
"glass": loader.loadSound('audio/glassbreak'),
"wood": loader.loadSound('audio/woodbreak')
};