Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@alloy
alloy / Rakefile
Last active March 23, 2016 10:36
A Rakefile that standardises program env installation and guides the user, as opposed to crashing with Ruby exceptions such as `LoadError`. The only case where this will *never* work reliably is if you use the `rubygems-bundler` (NOEXEC) plugin, which introduces chicken-and-egg problems.
# Do *not* load any libs here that are *not* part of Ruby’s standard-lib. Ever.
desc "Install all dependencies"
task :bootstrap do
if system('which bundle')
sh "bundle install"
sh "git submodule update --init"
# etc
else
$stderr.puts "\033[0;31m[!] Please install the bundler gem manually: $ [sudo] gem install bundler\e[0m"
@tfrisk-old
tfrisk-old / gist:11286970
Created April 25, 2014 11:52
Install Erlang and Elixir on Debian Wheezy (7.4)
#!/bin/sh
# Debian has older Erlang package (R15) in official repositories, Elixir requires newer (R17)
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
rm erlang-solutions_1.0_all.deb
# compile Elixir from source
@slashdotdash
slashdotdash / README.md
Last active April 9, 2019 12:52
React + D3 (v3)

Multi-series line chart rendered using React and D3.

@dmitshur
dmitshur / gist:6927554
Last active December 29, 2024 12:06
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.
@catsby
catsby / _output
Last active October 23, 2016 03:51
Requiring relatively with Elixir
$ ls
other_thing.exs
thing.exs
$ elixir thing.exs
calling other
other thing!
hooray!
@raucao
raucao / site.nginxconf
Last active November 18, 2021 22:12
Nginx log format for detailed JSON entries
log_format json '{"ip":"$remote_addr",'
'"time":"$time_local",'
'"host":"$host",'
'"method":"$request_method",'
'"uri":"$uri",'
'"status":$status,'
'"size":$body_bytes_sent,'
'"referer":"$http_referer",'
'"ua":"$http_user_agent"}';
@Sjors
Sjors / bitcoin-pay.rb
Last active April 9, 2024 16:50
This script demonstrates how a bitcoin transaction is created and signed. Just pass in your own address and private key and it will prepare a transaction for you. You can then copy & paste that transaction into a webservice like Blockchain to send it. I wrote this mostly to understand better how it works. I sometimes had to "cheat" and look at t…
#!/usr/bin/env ruby
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'pry'
require 'bigdecimal'
require 'bitcoin' # Because I need to cheat every now and then
# Usage:
# gem install pry json ffi ruby-bitcoin
@gr2m
gr2m / payments_dreamcode.js
Last active April 29, 2024 19:17
Imagine you could purchase items from your store, with pure JavaScript in the browser. How would it look like? Here's what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
// purchase a product with a credit card
purchase('productId')
.using( {
cc: "4556934156210213",
valid: "2016-10",
csc: "123"
} )
// purchase a product with paypal
purchase('productId')
@jballanc
jballanc / gist:4004243
Created November 2, 2012 20:55
MacRuby 1.0 vs RubyMotion for OS X

MacRuby Currently

  • Implements ~90% of Ruby functionality with some bugs
  • Can be used to create OS X desktop applications
  • Integrates with XCode
  • Uses the Obj-C GC (deprecated)

MacRuby 1.0

  • Fix known Ruby compatibility bugs
@ezmobius
ezmobius / gist:3686235
Created September 9, 2012 18:20
mendelmax slic3r config
# generated by Slic3r 0.9.0 on Sun Sep 9 11:01:56 2012
acceleration = 0
bed_size = 220,280
bed_temperature = 0
bridge_fan_speed = 100
bridge_flow_ratio = 1
bridge_speed = 70
brim_width = 0
complete_objects = 0
cooling = 1