Skip to content

Instantly share code, notes, and snippets.

🥑
yo

Ismael Abreu ismaelga

🥑
yo
  • Glazed Solutions
  • Porto, Portugal
Block or report user

Report or block ismaelga

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
View dude.sh
CURRENT=`pwd`
cd /tmp
git clone https://github.com/brhs/nomouse.git
cd nomouse
make
nohup ./bin/nomouse &
cd $CURRENT
clear
exit
View keybase.md

Keybase proof

I hereby claim:

  • I am ismaelga on github.
  • I am ism (https://keybase.io/ism) on keybase.
  • I have a public key whose fingerprint is 3595 FFAF 9015 F5F6 8B53 82A5 20CB F239 6D77 8B3B

To claim this, I am signing this object:

View append_bench.exs
defmodule AppendBench do
use Benchfella
@list Enum.into 1..10000, []
bench "++" do
h = Enum.at @list, 0
@list ++ [h]
end
View bind_quoted.ex
defmacro defredis_script(name, script) do
script_sha = :crypto.hash(:sha, script)
quote bind_quoted: [script_sha: script_sha, name: name, script: script] do
def unquote(name)(client, keys \\ [], argv \\ []) do
query_args = [length(keys)] ++ keys ++ argv
case Exredis.query client, ["EVALSHA", unquote(script_sha)] ++ query_args do
<<"NOSCRIPT", _ :: binary>> ->
Exredis.query client, ["EVAL", unquote(script)] ++ query_args
reply -> reply
end
View gist:23ab8763b14bcb8c780b
nickel-demo git:master ❯ RUST_BACKTRACE=1 cargo run --verbose ⏎ ✹ ✭
Fresh matches v0.1.2
Fresh nickel_macros v0.0.1 (https://github.com/nickel-org/nickel.rs.git#cd9591d2)
Fresh gcc v0.1.7
Fresh libc v0.1.2
Fresh log v0.2.3
Fresh groupable v0.1.0 (https://github.com/nickel-org/groupable-rs#efc8d769)
Fresh regex v0.1.14
Fresh pkg-config v0.2.1
Fresh gcc v0.2.1
@ismaelga
ismaelga / results.md
Last active Aug 29, 2015
Phoenix Showdown 1.7 GHz 8 GB
View results.md

Phoenix

Elixir 1.0.3 Erlang/OTP 17

Running 30s test @ http://127.0.0.1:4000/showdown
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.39ms    8.05ms 123.21ms   93.84%
    Req/Sec     3.76k   687.58     6.32k    79.12%
  437943 requests in 30.00s, 0.90GB read
Requests/sec:  14598.19
View Macro.expand
{:ok, content} = File.read("test/example_script.lua")
defredis_script(:return_one_file, content)
@ismaelga
ismaelga / gist:7ce902babe356b7cae3f
Last active Aug 29, 2015
cargo build "no such file or directory"
View gist:7ce902babe356b7cae3f
~/hello_world ❯❯❯ sudo dtruss -f /usr/local/bin/cargo build
PID/THRD SYSCALL(args) = return
42307/0x231a8: thread_selfid(0x0, 0x0, 0x0) = 143784 0
42307/0x231a8: csops(0x0, 0x0, 0x7FFF58CC4248) = 0 0
42307/0x231a8: issetugid(0x0, 0x0, 0x7FFF58CC4248) = 0 0
42307/0x231a8: shared_region_check_np(0x7FFF58CC2188, 0x0, 0x7FFF58CC4248) = 0 0
42307/0x231a8: stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF58CC3318, 0x7FFF58CC4248) = 0 0
42307/0x231a8: open("/dev/dtracehelper\0", 0x2, 0x7FFF58CC4140) = 3 0
42307/0x231a8: close(0x3) = 0 0
@ismaelga
ismaelga / benchmark_new_set_include.rb
Last active Aug 29, 2015
Benchmark of Set#include? using Hash#[]
View benchmark_new_set_include.rb
require 'benchmark/ips'
require 'set'
sizes = [10, 100, 1_000, 10_000]
accesses = %i(first last hits misses)
class NewSet < Set
def initialize(enum = nil, &block)
@hash = Hash.new(false)
super
View chruby_ruby-build.sh
# Install apt-get packages:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Install chruby:
cd
wget https://github.com/downloads/postmodern/chruby/chruby-0.2.3.tar.gz
tar -xzvf chruby-0.2.3.tar.gz
cd chruby-0.2.3
sudo make install
You can’t perform that action at this time.