Skip to content

Instantly share code, notes, and snippets.

View rrrene's full-sized avatar
👶
Chasing a toddler. I may be slow to respond.

René Föhring rrrene

👶
Chasing a toddler. I may be slow to respond.
View GitHub Profile
@rrrene
rrrene / autofixable_checks.exs
Created February 1, 2022 21:27
All Autofixable standard Credo checks
Credo.Check.Consistency.LineEndings
Credo.Check.Consistency.ParameterPatternMatching
Credo.Check.Consistency.SpaceAroundOperators
Credo.Check.Consistency.SpaceInParentheses
Credo.Check.Consistency.TabsOrSpaces
Credo.Check.Design.AliasUsage
Credo.Check.Readability.AliasOrder
Credo.Check.Readability.FunctionNames
Credo.Check.Readability.LargeNumbers
Credo.Check.Readability.ParenthesesInCondition
defmodule Converter do
def convert_image(_a, _b, _c) do
:ok
end
end
defmodule Converter.StepBuilder do
defmacro __using__(_opts \\ []) do
quote do
Module.register_attribute(__MODULE__, :steps, accumulate: true)

Keybase proof

I hereby claim:

  • I am rrrene on github.
  • I am rrrene (https://keybase.io/rrrene) on keybase.
  • I have a public key ASAM9dV1b3LCU4ryFJSXxTJpswoux58ZhE4-d7YlQeuf5Qo

To claim this, I am signing this object:

@rrrene
rrrene / Tex ERb key binding
Last active December 23, 2015 12:49
Key-Binding for erbify sublime snippet
{"keys": ["ctrl+shift+c"], "command": "insert_snippet","args": {"contents": "<%= ${1} \"$SELECTION\" %>"}}
@rrrene
rrrene / ecc.rb
Created May 15, 2013 10:50 — forked from bkerley/ecc.rb
# derived from http://h2np.net/tips/wiki/index.php?RubyOpenSSLDigitalSignatureSample
require 'openssl'
require 'base64'
include OpenSSL
group_name = 'secp521r1'
message = '10000 fartbux sent to bryce from a can of beans'
key = PKey::EC.new(group_name)
key = key.generate_key
{
"args": [],
"branch_name": "master",
"client_name": "inchjs",
"client_version": "0.4.0",
"git_repo_url": "https://github.com/foreverjs/forever.git",
"language": "javascript",
"objects": [
{
"comment": "//\n// ### @private function (file, options, callback)\n// #### @file {string} Target script to start\n// #### @options {Object} Options to start the script with\n// #### @callback {function} Continuation to respond to when complete.\n// Helper function that sets up the pathing for the specified `file`\n// then stats the appropriate files and responds.\n//",
@rrrene
rrrene / simplify_string.rb
Created July 19, 2010 21:17
Replace european accents and umlauts with their simple counterparts
# Replace european accents and umlauts with their simple counterparts
# ä -> a, ç -> c, etc.
class String
def simplify
gsub(/[àáâãäåæ]/i, 'a').
gsub(/[ç]/i, 'c').
gsub(/[èéêë]/i, 'e').
gsub(/[ìíîï]/i, 'i').
gsub(/[ñ]/i, 'n').
@rrrene
rrrene / my_console.rb
Created July 11, 2010 08:22
custom IRB console
#!/usr/bin/env ruby -wKU
# ... do some awesome stuff (requires, variable initialization, etc.)
require 'irb'
require 'irb/completion'
IRB.start
@rrrene
rrrene / all_models.rb
Created July 10, 2010 23:16
All Models in rails (that are already loaded)
# All Models in rails (that are already loaded)
Object.constants.map { |c|
c.constantize
}.select { |klass|
klass.is_a?(Class) && klass < ActiveRecord::Base
}

Few weeks back I was reading a blog about concurrency limitations in Ruby (which we all are aware since long) and how Elixir is evolving. Thus I was extremely curious to know this new dynamic functional programming language "Elixir", the two decades old Erlang language & Erlang Virtual Machine (VM) known for running low-latency, distributed and fault-tolerant systems.

This blog post is a result of my curiosity about Elixir and Erlang.