Skip to content

Instantly share code, notes, and snippets.

View inkel's full-sized avatar
:shipit:
The floating head with a beard

Leandro López inkel

:shipit:
The floating head with a beard
View GitHub Profile
#!/bin/bash
set -e
# Send a private message to someone on slack
# from the command line.
# Print a usage message and exit.
usage(){
local name=$(basename "$0")
@inkel
inkel / cachipulis.rb
Created July 27, 2012 14:06
Números cachipulis
#!/usr/bin/env ruby
param = ARGV.first
class Fixnum
def is_cachipulis?
length = self.to_s.length
digits = self.to_s.split('').map(&:to_i)
return false if digits.inject(&:+) != length
@inkel
inkel / chat.rb
Created December 14, 2011 12:57 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do