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
meme central:memescript/compiler;
requires io, c
where
io = central:stdlib/io
c = central:stdlib/curl/curl_prim
get: fun(url) {
c.curl_global_init(c.CURL_GLOBAL_DEFAULT);
var handle = c.curl_easy_init();
start = definitions;
module :m = definitions:xs => this.gen(m, xs);
definitions = [definition+:xs] => xs;
definition = include | struct_def | func;
include
= [:include string:name] => "#include " + name
.preamble(io, net)
io: meme:io;
net: meme:net;
.code
server: fun(clients) {
var server = net.TCPServer.new("::", "8000");
server.bindAndListen();
while (true) clients.put(server.accept_client());
}
.preamble(io, net)
io: meme:io;
net: meme:net;
.code
main: fun() {
var server = net.TCPServer.new();
server.bindAndListen("::", "8000");
while (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
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)
#!/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')
@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,
@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 / 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