Skip to content

Instantly share code, notes, and snippets.

Carlos Souza caike

Block or report user

Report or block caike

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
dch / erlang.rb
Created Jun 24, 2013
homebrew install Erlang/OTP R16B01 via `brew install --with-openssl -v`
View erlang.rb
require 'formula'
class ErlangManuals < Formula
url ''
sha1 '57ef01620386108db83ef13921313e600d351d44'
class ErlangHtmls < Formula
url ''
sha1 '6741e15e0b3e58736987e38fb8803084078ff99f'
evanwalsh / import.rb
Last active Feb 5, 2019
I imported my Jekyll from Squarespace's Wordpress XML with this
View import.rb
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'safe_yaml'
require 'time'
module JekyllImport
# This importer takes a wordpress.xml file, which can be exported from your
TJkrusinski /
Created Feb 10, 2014
Syntax highlighting in keynote made easy

Keynote I guess pushed an update that doesn't take hightlighted code from xCode anymore. So, I googled around and found hightlight. It is a super useful utitlity to do syntax highlighting from the command line.

$ brew install hightlight

If you are on Mavericks you may need to brew link lua to get it working right.

Hightlight has support for all kinds of languages and themes and it can wrap the code with line numbers, which is great.

View gist:f5f597f04b2efcb711c7
require 'mechanize'
require 'moving_average'
mechanize =
login_page = mechanize.get ''
form = login_page.forms.first
# noinspection RubyResolve
form.field_with(id: 'username').value = "username"
form.field_with(id: 'password').value = "pass"
nevern02 / my_server.rb
Last active Jul 27, 2018
Introductory Rack-compliant web server
View my_server.rb
require 'socket'
require 'rack'
require 'sinatra'
# Simple, rack-compliant web server
class MyServer
200 => 'OK',
500 => 'Internal Server Error'
kotakanbe / ipcalc.go
Created Sep 17, 2015
get all IP address from CIDR in golang
View ipcalc.go
package main
import (
func Hosts(cidr string) ([]string, error) {
cvan /
Last active Sep 11, 2019
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default


CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
sultanqasim /
Created Jun 21, 2016
ZRAM config for Raspberry Pi 3
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/ and make me executable
# then run "sudo update-rc.d defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
View cart.exs
# from ounce of elixir
defmodule CartTest do
use ExUnit.Case
test "starts with empty count" do
assert Cart.count_items([]) == 0
You can’t perform that action at this time.