Skip to content

Instantly share code, notes, and snippets.

View rodolfobandeira's full-sized avatar

Rodolfo rodolfobandeira

View GitHub Profile
@rodolfobandeira
rodolfobandeira / sidekiq_retry_time.csv
Created September 13, 2022 14:05 — forked from marcotc/sidekiq_retry_time.csv
Sidekiq retry exponential backoff formula times
Retry count Retry Time Total Cumulative Time Total Cumulative Days
0 0:00:00 0:00:00 0.0
1 0:00:16 0:00:16 0.0
2 0:00:31 0:00:47 0.0
3 0:01:36 0:02:23 0.0
4 0:04:31 0:06:54 0.0
5 0:10:40 0:17:34 0.0
6 0:21:51 0:39:25 0.0
7 0:40:16 1:19:41 0.1
8 1:08:31 2:28:12 0.1
@rodolfobandeira
rodolfobandeira / i3-cheat-sheet.md
Created July 30, 2022 16:03 — forked from miguelmota/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (window/command or alt by default depending on config)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@rodolfobandeira
rodolfobandeira / EnexToJson.java
Created October 18, 2020 21:09 — forked from aNNiMON/EnexToJson.java
Converts Evernote .enex files to json
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.EnumSet;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.json.JSONArray;
@rodolfobandeira
rodolfobandeira / README-Template.md
Created April 11, 2020 04:04 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@rodolfobandeira
rodolfobandeira / gist:4199c709d238a879e803aca9bbc4d380
Created October 31, 2019 12:55 — forked from philfreo/gist:7257723
Facebook Perl source code from 2005. When browsing around thefacebook.com in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
@rodolfobandeira
rodolfobandeira / web-fonts-asset-pipeline.md
Created April 16, 2019 02:22 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@rodolfobandeira
rodolfobandeira / character_set_and_collation.rb
Created March 10, 2019 04:04 — forked from tjh/character_set_and_collation.rb
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''
@rodolfobandeira
rodolfobandeira / rm_mysql.md
Created February 21, 2019 04:23 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@rodolfobandeira
rodolfobandeira / README.md
Created October 4, 2018 10:51 — forked from fasiha/README.md
clang-format.py for Vim integration with python3: from https://reviews.llvm.org/D23319

The current clang-format instructions are for Python2 Vim. If your Vim has only Python3 or if you load Python3 before Python2, those instructions won't work.

Therefore, (1) replace your clang-format.py with the file in this gist, from https://reviews.llvm.org/D23319. (2) Replace the relevant lines in .vimrc with:

map <C-K> :py3f ~/PATH/TO/clang-format.py<cr>
imap <C-K> <c-o>:py3f ~/PATH/TO/clang-format.py<cr>

N.B. Replace ~/PATH/TO with the actual path to clang-format.py.

@rodolfobandeira
rodolfobandeira / Parser.h
Created August 11, 2018 00:53 — forked from PanagiotisPtr/Parser.h
Json Parser in C++ with Libcurl and Jsoncpp
#ifndef PARSER_H
#define PARSER_H
#include <iostream>
#include <string>
#include <curl/curl.h>
#include <jsoncpp/json/json.h>
#include <jsoncpp/json/reader.h>
#include <jsoncpp/json/writer.h>