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
dch / erlang.rb
Created Jun 24, 2013
homebrew install Erlang/OTP R16B01 via `brew install --with-openssl -v https://gist.github.com/dch/5854160/raw/erlang.rb`
View erlang.rb
require 'formula'
class ErlangManuals < Formula
url 'http://erlang.org/download/otp_doc_man_R16B01.tar.gz'
sha1 '57ef01620386108db83ef13921313e600d351d44'
end
class ErlangHtmls < Formula
url 'http://erlang.org/download/otp_doc_html_R16B01.tar.gz'
sha1 '6741e15e0b3e58736987e38fb8803084078ff99f'
@evanwalsh
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
TJkrusinski / syntax.md
Created Feb 10, 2014
Syntax highlighting in keynote made easy
View syntax.md

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 = Mechanize.new
login_page = mechanize.get 'https://www.myfitnesspal.com/account/login'
form = login_page.forms.first
# noinspection RubyResolve
form.field_with(id: 'username').value = "username"
form.field_with(id: 'password').value = "pass"
form.submit
@nevern02
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
STATUS_CODES = {
200 => 'OK',
500 => 'Internal Server Error'
}
@kotakanbe
kotakanbe / ipcalc.go
Created Sep 17, 2015
get all IP address from CIDR in golang
View ipcalc.go
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@cvan
cvan / HOWTO.md
Last active May 14, 2019
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default
View HOWTO.md

Instructions

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
sultanqasim / zram.sh
Created Jun 21, 2016
ZRAM config for Raspberry Pi 3
View zram.sh
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh 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
#https://www.meetup.com/Women-Who-Code-Tampa/events/233014583/
ExUnit.start
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.