Skip to content

Instantly share code, notes, and snippets.


Manuel Albarran weapp

Block or report user

Report or block weapp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
weapp / optparse-template.rb
Created May 29, 2019 — forked from rtomayko/optparse-template.rb
Ruby optparse template
View optparse-template.rb
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
View plates.rb
#!/usr/bin/env ruby
require "bundler/inline"
gemfile do
source ""
gem "rack"
gem "foxy", git: "git://"
class App
View serializable_model.rb
class Field
attr_accessor :name, :type, :default
def initialize(name, type, default)
@name = name.to_s
@type = type
@default = default
View test.tmpl.exs
use ExUnit.Case
describe "description" do
setup do
weapp / Gemfile
Created May 30, 2017
dummy foxy example
View Gemfile
source ""
gem "foxy"
group :development, :test do
gem "pry"
gem "pry-byebug"

%title: Splats: beyond *args %author: weapp %date: 2017-04-20

-> # What is * (splat) <-

by urbandictionary

View maps_bench.ex
defmodule MyMap do
def bodyrecursive([]) do [] end
def bodyrecursive([h|t]) do [h + 1 | bodyrecursive(t)] end
def generic_bodyrecursive([], _) do [] end
def generic_bodyrecursive([h|t], fun) do [fun.(h) | bodyrecursive(t)] end
def tail(list) do tail(list, []) end
defp tail([], acc) do :lists.reverse(acc) end
defp tail([h|t], acc) do tail(t, [h + 1 | acc]) end
View benchmark_map_vs_pattern_matching.ex
defmodule Mod do
@table %{
a: 1, b: 2, c: 3, d: 4, e: 5,
f: 6, g: 7, h: 8, i: 9, j: 0,
def fun1(k) do @table[k] end
for {k, v} <- @table do
def fun2(unquote(k)) do unquote(v) end

based on:

The Gilded Rose Code Kata

This is a Elixir version of the Gilded Rose Kata, found here.

This is a refactorying kata, so you will be starting with a legacy code base. To work the Kata, clone this git repository and checkout the tag 'start-here'. Read the description below for the "rules"

weapp / Gemfile
Last active Feb 8, 2017
Paypal + Sinatra Integration
View Gemfile
# -*- coding: utf-8 -*-
source ''
gem 'sinatra'
gem 'faraday'
You can’t perform that action at this time.