Skip to content

Instantly share code, notes, and snippets.

View danielribeiro's full-sized avatar

Daniel Ribeiro danielribeiro

View GitHub Profile
This #thread is for those of you struggling to comprehend that the recent murders are just a fraction of racial violence in the United States. We are protesting for #GeorgeFloyd #BreonnaTaylor, #AhmaudArbery AND hundreds of years of oppression.
Let's begin your history lesson.
The Cincinnati Riots, 1829
Due to a rapid increase of Black migrants to the city, mobs of 200-300 white rioters attacked Black neighborhoods hoping to push them out of the city.
The Anti-Abolition Riots, NYC, 1834
@danielribeiro
danielribeiro / regtest.md
Last active October 26, 2017 21:24 — forked from t4sk/regtest.md
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -datadir=./ -printtoconsole

Generate block chain

> bitcoin-cli -regtest -datadir=./ generate 101

Keybase proof

I hereby claim:

  • I am danielribeiro on github.
  • I am danielrb (https://keybase.io/danielrb) on keybase.
  • I have a public key whose fingerprint is 0164 F512 6E2F B495 9962 EABA 8648 C5BC 8368 2261

To claim this, I am signing this object:

"""
Saves all webp images
"""
import io
from mitmproxy import http
def response(flow: http.HTTPFlow) -> None:
if flow.response.headers.get("content-type", "").startswith("image/webp"):
s = flow.response.content
@danielribeiro
danielribeiro / simulator_populator_xcode7
Last active September 21, 2017 09:45 — forked from cabeca/simulator_populator_xcode7
This script removes and recreates all simulators in Xcode 7.
#!/usr/bin/env ruby
require 'JSON'
device_types = JSON.parse `xcrun simctl list -j devicetypes`
runtimes = JSON.parse `xcrun simctl list -j runtimes`
devices = JSON.parse `xcrun simctl list -j devices`
devices['devices'].each do |runtime, runtime_devices|
runtime_devices.each do |device|
@danielribeiro
danielribeiro / distccd-rpi.plist
Created February 3, 2017 07:26 — forked from jvcleave/distccd-rpi.plist
mac distcc install instructions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>distccd-rpi</string>
<key>Program</key>
<string>/Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh</string>
<key>RunAtLoad</key>
<true/>
@danielribeiro
danielribeiro / keybase
Created December 13, 2016 06:09
keybase
### Keybase proof
I hereby claim:
* I am danielribeiro on github.
* I am danielrb (https://keybase.io/danielrb) on keybase.
* I have a public key whose fingerprint is C77E B7F0 DB78 7034 6923 A537 26A2 3CEA 2570 F304
To claim this, I am signing this object:
@danielribeiro
danielribeiro / signal.go
Created November 8, 2016 01:04 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@danielribeiro
danielribeiro / gist:70da0d180d4b44230cde09972623ef70
Created October 27, 2016 23:01 — forked from jedi4ever/gist:7677d62f1414c28a1a8c
Some notes on travisci remote debugging via ssh or screenshot or remote desktop of Mac VM builds
Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build.
#################################################
# Enable remote ssh access to travisci build for debugging
#################################################
# Add a key so we can login to travisci vm
- cat ssh/travisci.pub >> ~/.ssh/authorized_keys
- chmod 600 ssh/travisci
# Install netcat
@danielribeiro
danielribeiro / extensing_string.go
Created October 18, 2016 18:54
extensing_string.go
package main
import (
"fmt"
)
type MyString string
func (s MyString) plusa() MyString {
return s + "a"