Skip to content

Instantly share code, notes, and snippets.

View nofxx's full-sized avatar
🍺
Drinking

Duto Piccinini nofxx

🍺
Drinking
View GitHub Profile
humm?
@nofxx
nofxx / Rakefile
Created November 13, 2014 03:20
C++/Cpp Rakefile with includes, links... OpenCV example
#
# CPP Rakefile
#
EXEC = "square" # Your app executable
FLAGS = "-Wall -Wextra" # Flags for building
EXTRA = %w{ OpenCV } # Extra includes
#
# Nothing to see here, move along...
#
@nofxx
nofxx / mongodb.service
Created January 26, 2015 02:54
Systemd mongodb service for servers
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000
class Truco
NAIPES = %w{Ouro Copas Espada Paus}
SPECIALS = %w{Zap SeteCopas Espadilha SeteOuro}
VALUES = %w{3 2 A K J Q 7 6 5 4}
end
def <=>(other)
raise("Comparing a revision to #{other.class} is not supported") unless other.is_a? Revision
@number <=> other.number
end
# from cruisecontrol code...
# ruby = poem
class String
ACCIDENTS = {
:a => %w{ ã á â },
:e => %w{ é ê },
:i => %w{ í },
:o => %w{ õ ó ô },
:u => %w{ ú },
:c => %w{ ç }
}
def to_ascii
require 'activesms'
class Noter < ActiveSms::Base
def emaio
@delivery = :email
@carrier = 'tim'
@recipients = '55555555'
@from = ''
@body = "Hello"
module Compile
def self.c
system "ruby ext/extconf.rb && cd ext && make"
end
end
class Autotest
Autotest.add_hook :ran_command do |a|
Compile::c
end
end
module SubtitleIt
module Sub2Srt
def Sub2Srt.convert(filename)
framerate = 23.976
infile = File.open(filename,'r')
read_mode = 0
for line in inn do |line|
line.strip!