Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Adler Medrado adlermedrado

🎯
Focusing
View GitHub Profile
View keybase.md

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 Dec 31, 2017
Script to parse old HTML blog posts to Markdown with Pelican format.
View parser.py
import os
import re
from bs4 import BeautifulSoup
content_root = 'public'
total_files = 0
total_errors = 0
def convert_to_new_post(post_contents):
View dangolino.rb
# 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 Dec 12, 2015
Run an android app from command line
View run-android-app.sh
#!/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
@adlermedrado
adlermedrado / gist:1997929
Created Mar 8, 2012
Compilando o Xdebug para rodar no PHP 5.4
View gist:1997929
#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 Mar 8, 2012
Parâmetros de compilação do PHP
View gist:1997852
./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
View 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,
View closure_exemplo_5.php
<?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() {
View closure_exemplo_4.php
<?php
$arrExemploMap = array(1,2,3,4,5,6,7,8,9,10);
$ret = array_map(function($v) {
return $v * $v;
}, $arrExemploMap);
var_dump($ret);
?>
You can’t perform that action at this time.