Skip to content

Instantly share code, notes, and snippets.

Section "Device"
Identifier "Configured Video Device"
Driver "sis671"
EndSection
Section "Monitor"
HorizSync 28-72
VertRefresh 43-60
Identifier "Configured Monitor"
EndSection
@mtrovo
mtrovo / set_wallpaper.py
Created July 27, 2011 21:06
Simple python script to set the wallpaper on Ubuntu
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import commands
import os.path
from sys import argv
def set_gnome_wallpaper(file_path):
command = "gconftool-2 --set \
/desktop/gnome/background/picture_filename \
@mtrovo
mtrovo / twitterfilter.py
Created July 29, 2011 01:06
Twitter Streaming API sample using the filter stream
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from tweepy.streaming import StreamListener, Stream
from tweepy.auth import BasicAuthHandler
from tweepy.api import API
import tweepy
class MyStreamListener(StreamListener):
def __init__(self, api=None):
@mtrovo
mtrovo / add-quickfixj-m2-repo.sh
Created January 26, 2012 23:23
Install quickfixj binaries on a local maven repository
#!/bin/sh
mvn install:install-file -Dfile=quickfixj-core-1.5.3.jar -DgroupId=quickfixj \
-DartifactId=quickfixj-core -Dversion=1.5.3 -Dpackaging=jar
mvn install:install-file -Dfile=quickfixj-all-1.5.3.jar -DgroupId=quickfixj \
-DartifactId=quickfixj-all -Dversion=1.5.3 -Dpackaging=jar
@mtrovo
mtrovo / monitorscript.lang
Created February 13, 2012 01:49
Sintax highlighting for gedit 3 and GtkSourceView 3 for MonitorScript language used on Progress Apama product. This was based on Progress Apama version 4.2.
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of GtkSourceView
Author: Moises Trovo <moises.trovo@gmail.com>
Copyright (C) 2012 Moises Trovo <moises.trovo@gmail.com>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@mtrovo
mtrovo / SpamLord.py
Created March 14, 2012 04:54
NLP SpamLord PA slightly modified
import sys
import os
import re
import pprint
# lista com tuplas do seguinte formato (regex, tipo, email_final)
# abaixo exemplo adaptando o exemplo inicial
patterns = (
(r'(\w+)@(\w+).edu', 'e', r'\1@\2.edu'),
#TODO: aqui voce colocaria o resto das suas regex,
<html>
<body>
Arraste este <a href="javascript:void((function(){$=document.getElementById;document.getElementsByTagName('html')[0].style.overflow="";$('mask').style.display='none';$('pw-content').style.display='none'})())">link</a>
para a sua barra de favoritos.<br>
Toda vez que entrar em alguma página com o PayWall exigindo cadastro é só clicar no favorito que você salvou e pronto, você pode seguir lendo tranquilamente.
=]
</body>
@mtrovo
mtrovo / Modifiers_for_Linux.user.js
Last active December 10, 2015 18:08
GreaseMonkey script for enabling shortcuts modifiers (eg. ALT + R for Fast Reblog) on Linux platform.
// ==UserScript==
// @name Tumblr Shortcut Modifiers for Linux
// @namespace mtrovo
// @include http://www.tumblr.com/*
// @grant GM_log
// @version 1
// ==/UserScript==
var KeyCommandsForLinux = (function ($) {
return unsafeWindow.Backbone.View.extend({
@mtrovo
mtrovo / SelfReplicant.java
Created January 16, 2013 03:02
Self replicant java program for Thursday Code Puzzler of DZone
package mtrovo;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.