Skip to content

Instantly share code, notes, and snippets.

😅
what's up?

Mendelson Gusmão mendelgusmao

😅
what's up?
Block or report user

Report or block mendelgusmao

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
@mendelgusmao
mendelgusmao / btsync
Last active Sep 10, 2017
init.d script for btsync (based on another script built to run dropbox)
View btsync
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
View autoap.sh
#!/bin/sh
##############################################################################################
## ##
## AutoAP Next Gen by kuthulu/Iron, supported by wo-fo, infusion, drats, cid12, mathilda ##
## This script is inspired by the autoap script that stoped working after the command ##
## set of the "wl" was reduced in the DD-WRT V2.4 Beta firmware on the 18th of June 2007 ##
## ##
## http://sourceforge.net/projects/autoap ##
## ##
## AutoAP NG is a script that enables users to automatically log into different AP's ##
@mendelgusmao
mendelgusmao / antiwold.go
Last active Dec 14, 2015
A WOL daemon to shutdown the computer
View antiwold.go
package main
import (
"fmt"
"net"
"bytes"
"os/exec"
)
var (
View mediaboom.shitty.protection.js
// ==UserScript==
// @name MediaboomShittyProtection
// @namespace @MendelGusmao
// @include *mediaboom.org/*
// @version 1
// @require http://code.jquery.com/jquery-1.9.0.min.js
// @require https://raw.github.com/carlo/jquery-base64/master/jquery.base64.min.js
// ==/UserScript==
var matcher = /url=([^=]+)/;
@mendelgusmao
mendelgusmao / 20130128194931_add_attachment_avatar_to_users.rb
Last active Dec 11, 2015
Caching Dropbox URLs for paperclip-dropbox (not fully tested; not handling "missing" properly)
View 20130128194931_add_attachment_avatar_to_users.rb
class AddAttachmentAvatarToUsers < ActiveRecord::Migration
def self.up
change_table :users do |t|
t.attachment :avatar
end
add_column :users, :avatar_dropbox, :string, :default => {}.to_yaml
end
def self.down
@mendelgusmao
mendelgusmao / Gemfile
Last active Dec 11, 2015
rails + twitter-bootstrap-rails + heroku
View Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
# Gems used only for assets and not required
@mendelgusmao
mendelgusmao / wa.random.rb
Last active Jul 10, 2017
Random Winamp playlist using ActiveWinamp, Ruby and Win32OLE
View wa.random.rb
require "win32ole"
count = 100
ttl = 86400
cache_file = "wa.random.cache"
query = [
'type = "0"',
'length > "2:00"',
'title NOTHAS "intro"',
@mendelgusmao
mendelgusmao / Usage
Created Dec 5, 2012
Automatic key loader for Pageant
View Usage
wscript C:\path\to\pageant.loader.vbs
Tip: use mlin's StartupCPL http://www.mlin.net/StartupCPL.shtml
or add a shortcut to the vbs in the startup folder under start menu
View library.rb
** Invoke library:build (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute library:build
rake aborted!
undefined method `external_encoding' for #<String:0xa5e559c>
/usr/local/lib/ruby/1.9.1/psych.rb:203:in `parse'
/usr/local/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/usr/local/lib/ruby/1.9.1/psych.rb:151:in `parse'
/usr/local/lib/ruby/1.9.1/psych.rb:127:in `load'
View 1
/^(?<collection_path>.*(?<collection_name>MP\d))\\(?<genre_name>.*)\\((?<artist_name>.*)(\s\((?<country_name>.{3})\))?)\\(?<album_year>\d{4})\s-\s(?<album_title>.*)\\/
// !OK
"D:\\MP3\\Genre\\Artist (Cty)\\2004 - Album Title\\01 - Song Title.mp3" => {
"collection_path"=>"D:\\MP3",
"collection_name"=>"MP3",
"genre_name"=>"Genre",
"artist_name"=>"Artist (Cty)",
"country_name"=>nil,
"album_year"=>"2004",
You can’t perform that action at this time.