Skip to content

Instantly share code, notes, and snippets.

View fzero's full-sized avatar

Fabio Neves fzero

View GitHub Profile
@fzero
fzero / 1 tmux.conf
Last active February 7, 2024 15:00
Some tmux configurations, scripts and aliases I use.
# I prefer ctrl-a - helps when dealing with machines that only have Screen
unbind C-b
set -g prefix C-a
# Making windows purrty
set-window-option -g status-bg cyan
set-window-option -g status-fg black
set-window-option -g window-status-current-bg black
set-window-option -g window-status-current-fg white
@fzero
fzero / voice-recog.js
Last active January 9, 2023 16:25
Google Voice Recognition API example
// We've followed documentation links and played with the example code a bit:
// Start here: https://cloud.google.com/speech
// If you need an audio editor, try Audacity:
// https://www.audacityteam.org
//
// usage: node voice-recog.js soundfile.flac en-US
//
// The second argument is the language code (e.g. en-US, pt-BR, fr-CA...)
@fzero
fzero / keymap.cson
Created January 24, 2017 20:26
Fix atom keymap with vim-mode-plus
'atom-text-editor.vim-mode-plus':
'ctrl-c': 'core:copy'
'ctrl-x': 'core:cut'
'ctrl-v': 'core:paste'
'atom-text-editor.vim-mode-plus.insert-mode':
'ctrl-c': 'core:copy'
'ctrl-x': 'core:cut'
'ctrl-v': 'core:paste'
@fzero
fzero / 1 bashrc.sh
Last active August 4, 2021 00:06
My bash customizations with git-aware prompt and some aliases.
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Prompt goodness
#
# This is for my local machine, so I don't display the host to save space (I do on remote servers).
# It looks like this:
#
# ~/Code/some_dir(my-git-branch)$
#
@fzero
fzero / flickrdl.rb
Created December 20, 2019 01:26
Threaded download from Flickr (not a complete script, but the main part)
require 'flickr_fu'
require 'httparty'
require 'pry'
DIR = "./photos"
MAXTHREADS = 30
# Prepare the downloadin'
`mkdir -p #{DIR}`
@fzero
fzero / pgfix.md
Created December 7, 2016 16:42
Fix Postgres encoding issue

Is you attempt to do a bin/rails db:setup or something similar and it complains like this:

PG::InvalidParameterValue: ERROR:  encoding "UTF8" does not match locale "en_US"
DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".

Run these commands in your Vagrant box:

@fzero
fzero / threads.rb
Last active July 30, 2018 18:27
Ruby skeleton for parallel iteration using threads with thread count
# Thread count control
MAXTHREADS = 30
# This is the collection of data you need to process with threads
collection = []
# A nice array to store your thread objects
threads = []
@fzero
fzero / 0README.md
Created May 28, 2018 16:05
RBC Frontend fundamentals - Advanced CSS
@fzero
fzero / 0README.md
Last active May 24, 2018 20:01
RBC Frontend fundamentals - Flexbox
@fzero
fzero / 0README.md
Last active May 22, 2018 16:17
RBC - Lecture notes - May 22, 2018

Intro to CSS

This is the code we've worked on during May 22 class. Feel free to use it as reference!