Skip to content

Instantly share code, notes, and snippets.

View clarete's full-sized avatar
🌴
On vacation

Lincoln Clarete clarete

🌴
On vacation
View GitHub Profile
#!/usr/bin/env python
import argparse
import gitlab3
import io
import os
import sys
def parse_command_line_arguments(args):
parser = argparse.ArgumentParser(description='Manage GitLab deploy keys')
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return 'oi! voce veio do site: {0}. Clique <a href="/">aqui</a>'.format(flask.request.referrer)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)
#!/bin/sh
BOTOFILE=${HOME}/.boto
### Helpers
helper_profile_name() {
printf $(basename $1) | cut -d. -f3
}
### List all the configuration files we have for boto
@clarete
clarete / gist:4012731
Created November 4, 2012 17:41
Brew formula for the iksmel library
require 'formula'
class Iksemel < Formula
homepage 'http://code.google.com/p/iksemel/'
url 'https://code.google.com/p/iksemel.git', :revision => '978b733462e41efd5db72bc9974cb3b0d1d5f6fa'
version '1.5'
depends_on 'libtool' => :build
depends_on 'gnutls'
@clarete
clarete / robot.js
Created December 1, 2012 01:30
headlessrobot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(_WIN32)
#include <windows.h>
#elif defined(__linux__)
#include <sys/stat.h>
#include <sys/mman.h>
#endif
@clarete
clarete / taningia.rb
Created January 30, 2013 02:11
Brew formula for taningia (http://github.com/clarete/taningia)
require 'formula'
class Taningia < Formula
homepage 'https://github.com/clarete/taningia'
url 'https://github.com/clarete/taningia.git'
version '0.2.3'
depends_on 'pkg-config' => :build
depends_on 'autoconf' => :build
depends_on 'automake' => :build
@clarete
clarete / gensplitcharts.py
Created February 26, 2013 15:51
Generates charts about the split test data collected by the script collectsplitdata.py
import json
import pygal
# Parsing the json file
content = json.load(open('split.json'))
# App app names
app_names = list({x['what'] for x in content['app']})
# All file names
@clarete
clarete / mysqlbackup.sh
Created November 26, 2013 20:52
Backup each database inside of mysql in a separate .sql.gz file
#!/bin/bash
#
# I usually start the server with the following command
# before running this script:
#
# $ mysqld_safe --skip-grant-tables
#
# Than just run the following script and all the databases
# are gonna be saved in separate files in the current
# directory. Ps.: It does not check for existing files,
.preamble(io, net)
io: meme:io;
net: meme:net;
.code
main: fun() {
var server = net.TCPServer.new();
server.bindAndListen("::", "8000");
while (true) {