Skip to content

Instantly share code, notes, and snippets.

View adlermedrado's full-sized avatar
🏠
Working from home

Adler Medrado adlermedrado

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am adlermedrado on github.
  • I am adlermedrado (https://keybase.io/adlermedrado) on keybase.
  • I have a public key ASBn5dMYtKwybgMRmFB4AbSsZQpI7LscezUpdKiK_4HNyAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am adlermedrado on github.
  • I am adlermedrado (https://keybase.io/adlermedrado) on keybase.
  • I have a public key ASD5hhHJEp_Tx9thN6jYOe1VOGSA6GGAf683vecsTsqzowo

To claim this, I am signing this object:

@adlermedrado
adlermedrado / parser.py
Created December 31, 2017 19:57
Script to parse old HTML blog posts to Markdown with Pelican format.
import os
import re
from bs4 import BeautifulSoup
content_root = 'public'
total_files = 0
total_errors = 0
def convert_to_new_post(post_contents):
# encoding: utf-8
config_path = File.expand_path(File.dirname(__FILE__))
config_path = config_path.gsub('/bin', '/lib')
require "rubygems"
require "sequel"
require "date"
require 'optiflag'
require 'yaml'
@adlermedrado
adlermedrado / run-android-app.sh
Last active December 12, 2015 06:09
Run an android app from command line
#!/bin/bash
# Antes de executar esse script, execute o comando abaixo e aguarde o emulador iniciar (pode demorar um pouco).
# emulator -avd meu-emulador-maroto &
# Depois que o emulador carregar, sempre que você rodar esse script ele irá gerar uma build nova do projeto, instalar no emulador e em seguida o inicializará.
# Dá pra executar direto no dispositio também, mas como não estou usando, não coloquei o exemplo aqui :-)
ant debug install && adb shell am start -a android.intent.action.MAIN -n br.com.adlermedrado/.MyApp && adb logcat
<?php
phpinfo();
?>
@adlermedrado
adlermedrado / gist:1997929
Created March 8, 2012 01:44
Compilando o Xdebug para rodar no PHP 5.4
#clonando o projeto para /usr/local/src
cd /usr/local/src
git clone https://github.com/derickr/xdebug
#acessa o diretório com os fontes
cd xdebug
#roda o phpize
phpize
@adlermedrado
adlermedrado / gist:1997852
Created March 8, 2012 01:27
Parâmetros de compilação do PHP
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr
--with-kerberos=/usr --with-zlib=/usr --enable-gd-native-ttf --with-icu-dir=/usr --with-iodbc=/usr
--with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --enable-bcmath
--with-bz2=/usr --enable-calendar --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem
--enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock
--with-readline=/usr --enable-shmop --with-snmp=/usr --with-curl=/usr --enable-dba --enable-exif --enable-ftp
--with-gd --with-freetype-dir=/usr/X11/ --with-jpeg-dir=/usr/X11/ --with-png-dir=/usr/X11/ --enable-zip
--with-pcre-regex=/usr --with-pgsql=/usr --with-pdo-pgsql=/usr
@adlermedrado
adlermedrado / Mongoose example
Created October 21, 2011 19:53 — forked from mcantelon/Mongoose example
Mongoose example
// from Horofox in #node.js
var mongoose = require('mongoose');
var db = mongoose.connect('mongodb://localhost/mydb');
function allowPosts(mongoose) {
var Schema = mongoose.Schema;
var Posts = new Schema({
name : String,
subject: String,
comment : String,
<?php
class Lambida {
public function hello($param1, $callback) {
echo 'Esse é o valor do $param1: ' . $param1 . '<br />';
echo $callback();
}
}
$lambida = new Lambida();
$lambida->hello('Eu amo muito tudo isso', function() {