Skip to content

Instantly share code, notes, and snippets.

View fmeyer's full-sized avatar
👨‍💻
Grinding

Fernando Meyer fmeyer

👨‍💻
Grinding
View GitHub Profile
@zed9h
zed9h / exchange_cleanup.pl
Created July 17, 2009 04:07
connect imap server to clenaup unwanted emails
#!/usr/bin/perl
use strict;
use warnings;
use Net::IMAP::Simple;
use Encode qw/encode decode/;
my $host = 'imap.server.com'
my $login = 'carlo.caputo';
my $password = '123456';
my $delete_pattern = 'Undeliverable: (maillist|useless|automatic)';
#!/usr/bin/env ruby
require 'net/imap'
require 'rubygems'
require 'tmail'
# Introduction:
#
# This small library is to archive emails from an imap server
@tobym
tobym / redis_pubsub_demo.rb
Created April 1, 2010 16:50 — forked from pietern/redis_pubsub_demo.rb
Redis PubSub demo with EventMachine (chat service)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
@dcrec1
dcrec1 / centos
Last active March 24, 2017 11:52
ubuntu/centos nginx
cd /tmp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -Uhv rpmforge-release*.rf.i386.rpm
yum install readline-dev htop
@ghedo
ghedo / sound_playback.c
Last active March 2, 2024 08:47
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
@pedroteixeira
pedroteixeira / hash.rb
Created March 18, 2012 18:11
hash syntax
class Hash
def id
self["id"] || self[:id]
end
def type
self["type"] || self[:type] || self.type
end
def method_missing(meth, *args, &block)
if args.size == 0
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@urubatan
urubatan / remove_dups.rb
Created May 24, 2012 14:42
Ruby script to remove duplicated files, I created it when migrating my pictures collection from iPhoto to picasa, and merged some independent collections, it created a real mess, and the result of this big mess is this gist.
require 'digest/sha1'
require 'fileutils'
directories = [
"SOURCE DIR 1",
"SOURCE DIR 2"
]
files = {}
directories.each do |dir_name|
puts "Scanning Directory: #{dir_name} "
Dir.glob("#{dir_name}/**/*.*") do |file_name|
@Jud
Jud / Price-Time Matching Engine.c
Created June 1, 2012 23:56
Price-Time Matching Engine
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})