Skip to content

Instantly share code, notes, and snippets.

View schmurfy's full-sized avatar
:octocat:

Julien Ammous schmurfy

:octocat:
View GitHub Profile
@marszall87
marszall87 / docker-compose-install.sh
Created September 25, 2015 13:14
Simple script for installing latest Docker Compose on CoreOS >= 717.0.0
#!/bin/bash
mkdir -p /opt/bin
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
@haf
haf / LICENSE
Last active February 14, 2024 11:15
Setting up a digitalocean proxy
https://www.gnu.org/licenses/gpl-3.0.en.html
GNU GENERAL PUBLIC LICENSE v3
@cvengros
cvengros / gist:b2a7e82f66519d423b6f
Created November 15, 2014 01:30
Download directory from GitHub through API
class GitHub
class << self
def download_file_to_string(github_token, setup={}, raw=true, link=nil)
if link
url = link
else
sql_repo_name = setup['repo_name']
sql_repo_owner = setup['repo_owner']
# URI join won't make it:
@frsyuki
frsyuki / article.md
Last active June 23, 2020 12:02
MessagePack for Ruby version 5

MessagePack for Ruby version 5

Today, I released the new version of MessagePack for Ruby!

Even faster

I rewrote all the code and achieved significant performance improvement, especially for serialization. I compared the new version to the old version (v4) using ruby-serializers benchmark, and the new version is faster for all data sets including Twitter, Image, Integers, Geo and 3D model.

@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@mattetti
mattetti / gist:3850240
Created October 8, 2012 01:19
Rakefile to generate a mruby mandelbrot example
# Change the path to match the path to your machine.
$mrb_path = File.expand_path("~/src/mruby")
$mrbc = File.join($mrb_path,"/bin/mrbc")
task :default do
# dumps the Ruby file to disk
File.open("mandelbrot.rb", "w"){|f| f << mandelbrot_ruby_code }
# creates the .c file containing mandelbrot char array for the bytecode
`#{$mrbc} -Bmandelbrot_bytecode ./mandelbrot.rb`
example_file = wrapper_code(File.read("./mandelbrot.c"))
@matz
matz / gist:3066997
Created July 7, 2012 16:00
code to migrate between 2 mrb_state
#include "mruby.h"
#include "mruby/string.h"
#include "mruby/array.h"
mrb_value
migrate_simple_value(mrb_state *mrb, mrb_value v, mrb_state *mrb2)
{
mrb_value nv; /* new value */
const char *s;
int len;
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL