Skip to content

Instantly share code, notes, and snippets.

View adamico's full-sized avatar

Andrea D'Amico adamico

  • France
  • 10:48 (UTC +02:00)
View GitHub Profile
@adamico
adamico / en.yml
Last active June 21, 2017 05:46 — forked from johnjohndoe/uri_validator.rb
Rails 4 with I18n working interpolations
en:
errors: &errors
messages:
bad_uri: is an invalid url
bad_protocol: must start with %{protocols}
activemodel:
errors:
<<: *errors
activerecord:
errors:
@adamico
adamico / Gemfile
Created July 30, 2015 12:46
Use CombinePDF in a Rails app to merge existing PDF files with Prawn generated PDF content
gem 'combine_pdf'
gem 'prawn'
gem 'paperclip'
@adamico
adamico / pack.c
Created November 28, 2015 14:39
C source of .pack in ruby
static VALUE
pack_pack(VALUE ary, VALUE fmt)
{
static const char nul10[] = "\0\0\0\0\0\0\0\0\0\0";
static const char spc10[] = " ";
const char *p, *pend;
VALUE res, from, associates = 0;
char type;
long items, len, idx, plen;
const char *ptr;
@adamico
adamico / cf_modpack_workflow.md
Last active September 28, 2023 14:46
Workflow to manage Minecraft Curseforge modpacks