Skip to content

Instantly share code, notes, and snippets.

Rodrigo Lopes rodvlopes

Block or report user

Report or block rodvlopes

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
@rodvlopes
rodvlopes / file.js
Created Apr 30, 2019
My sublime text settings and key biddings
View file.js
//Preferences.sublime.settings
{
"folder_exclude_patterns":
[
"node_modules",
".svn",
".git",
".hg",
"CVS"
],
View StdoutSink.py
class StdoutSink(spotify.sink.Sink):
def __init__(self, session):
self._session = session
self.on()
def _on_music_delivery(self, session, audio_format, frames, num_frames):
assert (
audio_format.sample_type == spotify.SampleType.INT16_NATIVE_ENDIAN)
@rodvlopes
rodvlopes / unity-monitor.py
Last active Dec 19, 2015
Ubuntu Unity Indicator to monitor HTTP services. Any service that returns text "ok". Read services urls from external file services.cfg. No need to restart after changing the configuration file.
View unity-monitor.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import gtk
import appindicator
import urllib2
import re
import os
from ConfigParser import ConfigParser
@rodvlopes
rodvlopes / respostas.rb
Created Mar 29, 2012
Lista de respostas das questões do concurso de analista de sistemas da Petrobras
View respostas.rb
#!/usr/bin/env ruby
# encoding: utf-8
PROVAS = {
:petro_pro_2010 => %q(A,C,A,B,E,B,E,A,C,B,B,E,B,D,A,B,C,E,E,B,D,D,E,E,D,C,C,E,D,A,C,A,A,D,E,D,A,B,C,A,A,A,D,E,C,D,A,E,A,B,D,D,A,A,E,C,D,E,B,D,E,D,A,A,B,A,C,D,E,B).split(','),
:petro_eng_2010 => %q(C,B,B,E,A,E,E,D,A,D,A,B,C,A,B,C,D,B,E,C,A,E,D,C,C,B,E,E,B,A,D,B,B,A,A,C,A,D,A,C,C,B,D,D,D,D,A,D,E,C,E,B,E,D,A,B,B,X,A,B,E,C,X,D,A,B,C,D,D,E).split(','),
:petro_eng_2011 => %q(C,D,B,A,A,A,E,B,C,A,C,A,A,C,E,B,D,D,E,D,E,C,D,A,D,B,A,A,C,C,A,B,D,D,E,C,B,C,C,X,D,A,E,C,C,A,B,C,B,E,B,C,E,A,C,C,E,C,D,A,D,E,A,A,B,X,A,E,A,B).split(',')
}
def main
@rodvlopes
rodvlopes / wifistrength.sh
Created Mar 29, 2012
Script para exibir a cada segundo a força do sinal da rede sem fio conectada
View wifistrength.sh
#!/bin/sh
#author: rodvlopes
while true
do
echo `date "+%H:%M:%S"` `iwconfig wlan0|grep Signal|cut -d"=" -f3|cut -d" " -f1`
sleep 1
done
@rodvlopes
rodvlopes / lru.rb
Created Jul 11, 2011
LRU Algorithm
View lru.rb
#!/usr/bin/env ruby
# O algoritmo LRU (Least Recently Used) é utilizado em sistemas operacionais como método
# de substituição de páginas. Considerando que 4 páginas são alocadas na memória principal,
# após a requisição das páginas 4, 7, 5, 7, 6, 7, 10, 4, 8, 5, 8, 6, 8, 11, 4, 9, 5, 9, 6,
# 9, 12, 4, 7, 5, 7 o número de falhas de página (page faults) será
# (A) 15 (B) 17 (C) 19 (D) 21 (E) 23
@rodvlopes
rodvlopes / cruisecontrolrb
Created Jan 25, 2010
init/rc cruisecontrol.rb daemon
View cruisecontrolrb
#! /bin/sh
### BEGIN INIT INFO
# Provides: cruisecontrol.rb
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: CruiseControl.rb
# Description: Continuous build integration system. This runs the web interface (via mongrel and the builders).
### END INIT INFO
@rodvlopes
rodvlopes / st3keys
Created Aug 27, 2014
SublimeText 3 Key binds
View st3keys
[
{ "keys": ["ctrl+alt+d"], "command": "find_under_expand" },
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["f3"], "command": "find_under" },
{ "keys": ["shift+f3"], "command": "find_under_prev" },
{ "keys": ["f9"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 5.0 } },
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -5.0 } },
{ "keys": ["ctrl+alt+d"], "command": "find_under_expand" },
{ "keys": ["ctrl+k", "ctrl+d"], "command": "find_under_expand_skip" },
You can’t perform that action at this time.