Skip to content

Instantly share code, notes, and snippets.

View dimiro1's full-sized avatar

Claudemiro A F Neto dimiro1

  • Berlin, Germany
View GitHub Profile
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@dimiro1
dimiro1 / gist:2666262
Created May 12, 2012 12:22 — forked from amateurhuman/gist:2005745
Installing Rubinius 2.0.0-dev with rbenv

Installing rbx-2.0.0-dev with Ruby 1.9 support using rbenv can be a tad tricky. This is what I did to get up and running, you'll need another version of ruby already installed as well as rake.

The basic outline:

  1. Clone Rubinius HEAD from github
  2. Configure installation for rbenv and 1.9 support
  3. Install Rubinius
  4. Configure your $PATH to use Rubinius gems
  5. Start using Rubinius
@dimiro1
dimiro1 / 1.8.7-p358-with-rogue-stdout-patch
Created May 12, 2012 12:25 — forked from kungfoo/1.8.7-p358-with-rogue-stdout-patch
Installing 1.8.7-p358 with rbenv, when glibc >= 2.14 is installed
build_package_stdout_patch() {
wget 'http://bugs.ruby-lang.org/attachments/download/1931/stdout-rouge-fix.patch'
patch -p1 < stdout-rouge-fix.patch
}
require_gcc
install_package "ruby-1.8.7-p358" "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.gz" stdout_patch standard
install_package "rubygems-1.6.2" "http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz" ruby
@dimiro1
dimiro1 / paginate.rb
Created May 14, 2012 16:52
PaginationBuilder
require 'ramaze/gestalt'
module Ramaze
module Helper
# Helper for pagination and pagination-navigation.
#
# See {Ramaze::Helper::Paginate#paginate} for more information.
#
module Paginate
include Traited
@dimiro1
dimiro1 / passenger-management.rb
Created May 24, 2012 16:16 — forked from loopj/passenger-management.rb
Checks memory usage of all paseenger child process and kill if grows too large. Additionally kill off long running passengers to prevent memory leak issues (similar to the PassengerMaxRequests config variable in apache's passenger version, but works on bo
#!/usr/bin/env ruby
#
# Passenger management script
# By James Smith http://loopj.com
# Based heavily on a similar script by Jon Bettcher
#
# Check memory usage of all paseenger child process and kill if grows
# too large.
#
@dimiro1
dimiro1 / abnt-CEUT.sty
Created June 4, 2012 19:23
ABNT CEUT
%% Copyright (C) 2011 Claudemiro Feitosa <[email protected]>
%%
%% Fortemente baseado no abnt-UFPR.sty
%%
\NeedsTeXFormat{LaTeX2e}
\usepackage[utf8]{inputenc}
%% http://www.terminally-incoherent.com/blog/2006/12/17/latex-numbered-subsubsections/
@dimiro1
dimiro1 / CorreiosUnit.java
Created June 15, 2012 01:33
Correios HtmlUnit
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.*;
import java.io.IOException;
public class CorreiosCep {
private static final String URL = "http://www.buscacep.correios.com.br/";
private static final String CEP = "64011010";
@dimiro1
dimiro1 / album.css
Created August 23, 2012 01:48
Album DietaJa
.galeria{position:relative;margin:10px 0px}.galeria .pika-stage{width:625px;min-height:455px;padding-top:133px}.galeria .pika-stage .pika-aniwrap{position:absolute;top:10px;left:10px;z-index:9;display:none}.galeria .caption{position:relative}.galeria .pika-thumbs li{width:189px;height:133px;cursor:pointer;float:left;list-style:none;overflow:hidden;margin:0px 1px}.galeria .pika-thumbs .clip{position:relative;width:189px;height:133px;overflow:hidden}.galeria .pika-stage{text-align:center}.galeria .pika-stage .caption{font:normal 12px Arial,sans-serif;font-style:italic;padding:10px 5px;color:#000;text-align:left;background:#dbd8ed;display:block;clear:both;margin-top:-3px}.galeria .pika-stage .caption a{color:black}.galeria .pika-imgnav a{position:absolute;top:0px;text-indent:-5000px;height:61px;width:42px;display:block;z-index:11;cursor:pointer}.galeria .pika-imgnav .next,.galeria .pika-imgnav .previous{top:154px}.galeria .pika-imgnav .previous{display:none}.galeria .pika-imgnav .next{display:none}.galeria .pika
frutas = ['maçã', 'pera', 'laranja']
for fruta in frutas:
print(fruta)
@dimiro1
dimiro1 / index.html
Created December 2, 2013 18:53
Basic Responsive Ads
<!DOCTYPE html>
<html>
<head>
<title>Responsive Ads</title>
</head>
<body>
<div class="728x90">
</div>