Skip to content

Instantly share code, notes, and snippets.

View lorenzosinisi's full-sized avatar
🦄
Elixir

Lorenzo Sinisi lorenzosinisi

🦄
Elixir
View GitHub Profile
@lorenzosinisi
lorenzosinisi / .vimrc
Created December 19, 2017 09:26
Vimrc config for Elixir
"""""""""""""""""""""""""""""""""""""
" Lorenzo Sinisi Vimrc configuration
"""""""""""""""""""""""""""""""""""""
set nocompatible
syntax on
set nowrap
set ignorecase
set smartcase
set encoding=utf8
set mouse=nicr
"""""""""""""""""""""""""""""""""""""
" Lorenzo Sinisi Vimrc configuration
"""""""""""""""""""""""""""""""""""""
set nocompatible
syntax on
set nowrap
set ignorecase
set smartcase
set encoding=utf8
set mouse=nicr
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set expandtab
set tabstop=2
set shiftwidth=2
set splitright
set number
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Colorsublime - Themes/Solarized-dark.tmTheme",
"copy_with_empty_selection": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
"production",
devise_for :coaches,
path: 'coaches',
path_names: {
sign_in: 'login',
sign_out: 'logout',
password: 'secret',
confirmation: 'verification',
unlock: 'unblock',
registration: 'register',
sign_up: 'new'
class RegistrationsController < Devise::RegistrationsController
before_action :check_captcha, only: [:create]
private
def check_captcha
binding.pry # it should stop here
unless verify_recaptcha
self.resource = resource_class.new sign_up_params
respond_with_navigational(resource) { render :new }
end
# source http://www.thegermanprofessor.com/top-500-german-words/
# they are really 429 and not 500 but a pretty good start
["und", "sein", "in", "an", "zu", "at", "haben", "ich", "werden", "sie", "her", "them",
"von", "nicht", "mit", "es", "sich", "auch", "auf", "für", "an", "so", "dass", "können", "dies",
"als", "when", "ihr", "her", "theirs", "ja", "wie", "bei", "oder", "wir", "aber", "dann", "man",
"da", "sein", "its", "noch", "nach", "was", "also", "aus", "all", "wenn", "nur", "müssen", "sagen",
"um", "machen", "kein", "du", "mein", "schon", "vor", "durch", "geben", "mehr", "anderes", "viel",
"kommen", "jetzt", "sollen", "mir", "wollen", "ganz", "all the", "mich", "immer", "gehen", "sehr",
"hier", "doch", "still", "bis", "groß", "wieder", "zwei", "gut", "wissen", "neu", "sehen", "lassen",
"have", "uns", "weil", "unter", "denn", "stehen", "jed", "die", "erstes", "ihm", "it", "ihn", "wo",
@lorenzosinisi
lorenzosinisi / vimrc
Created May 10, 2016 13:51
vimrc file
set nocompatible " be iMproved, required
filetype off " required
autocmd ColorScheme * if g:colors_name == 'solarized' | hi link matlabComma Normal | else | hi link matlabComma SpecialKey | endif
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set expandtab
set tabstop=2
set shiftwidth=2
# How to find out when and where a method is called in Rspec
puts "CALLED :#{caller_locations(1,1)[0].label} at #{caller_locations[1]}".red
@lorenzosinisi
lorenzosinisi / buergerbot.rb
Created April 21, 2016 18:46 — forked from pbock/buergerbot.rb
Bürgerbot: Refreshes the Berlin Bürgeramt page until an appointment becomes available, then notifies you.
#!/usr/bin/env ruby
require 'watir-webdriver'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification "Bürgerbot" with title "%s"\'' % message
rescue StandardError => e