Skip to content

Instantly share code, notes, and snippets.

View diegofigueroa's full-sized avatar

Diego Figueroa diegofigueroa

View GitHub Profile
<?xml version="1.0" ?>
<rss xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>Compra en Línea - Sitio Oficial El Palacio de Hierro</title>
<link>https://www.elpalaciodehierro.com</link>
<description>Encuentra las últimas novedades de las mejores marcas en Moda, Tecnología, Línea Blanca, Computo, Smarthphones, Deportes, Hogar y más. Envíos a Domicilio.</description>
<item><g:id>40929403</g:id><g:condition>NEW</g:condition><g:title>Anillo en plata Corona de margaritas Moments Mujer Talla: 50</g:title><g:link>https://www.elpalaciodehierro.com/pandora-anillo-en-plata-corona-de-margaritas-moments-mujer-talla-50-40929403.html</g:link><g:description>Anillo Pandora de la colección Pandora Moments Talla: 50; elaborado en plata con diseño de una hermosa corona de margaritas e incrustaciones de zirconia cúbica. Esta alianza de margaritas con pequeñas piedras en el centro se inspira en la resistencia de esta flor que florece en la adversidad y simboliza la libertad.• Talla: 50.</g:description><g:availability>in s
@diegofigueroa
diegofigueroa / gh2bb_migrate_cheapass.py
Created July 17, 2018 18:10
Migrate all your private github repos to bitbucket because you're CHEAP.
__author__ = 'schwa'
import os
import subprocess
import glob
from github import Github # pip install PyGithub
from bitbucket.bitbucket import Bitbucket # pip install --user bitbucket-api
GH_USERNAME = 'jwight@mac.com'
GH_PASSWORD = '1234'
@diegofigueroa
diegofigueroa / bitbucket-to-github.rb
Created July 17, 2018 18:05 — forked from rbellamy/bitbucket-to-github.rb
Bulk import Bitbucket repos to Github
#!/usr/bin/env ruby
require 'fileutils'
# Originally -- Dave Deriso -- deriso@gmail.com
# Contributor -- G. Richard Bellamy -- rbellamy@terradatum.com
# If you contribute, put your name here!
# To get your team ID:
# 1. Go to your GitHub profile, select 'Personal Access Tokens', and create an Access token
# 2. curl -H "Authorization: token <very-long-access-token>" https://api.github.com/orgs/<org-name>/teams
# 3. Find the team name, and grabulate the Team ID
@diegofigueroa
diegofigueroa / pointers&arrays.c
Created January 19, 2014 18:00
Very simple sample of a pointer pointing to an array's base address.
#include <stdio.h>
void main(){
int array[3] = {5, 10, 15};
int* p;
p = array;
printf("p = %p, *p = %d\n", p, *p);
p = &array;
@diegofigueroa
diegofigueroa / legendary.rb
Created December 16, 2013 21:00
Streaming example with sinatra.
get '/' do
stream do |out|
out << "It's gonna be legen -\n"
sleep 0.5
out << " (wait for it) \n"
sleep 1
out << "- dary!\n"
end
end
require 'rubygems'
require 'rack/oauth2'
client = Rack::OAuth2::Client.new(
:identifier => YOUR_CLIENT_ID,
:secret => YOUR_CLIENT_SECRET,
:redirect_uri => YOUR_REDIRECT_URI, # only required for grant_type = :code
:host => 'rack-oauth2-sample.heroku.com'
)
use Struct.new(:app) {
def call(env)
env["rack.errors"] = $stdout
app.call(env)
end
}
use Rack::Logger, $your_log_level
use Rack::CommonLogger
run YourApp
@diegofigueroa
diegofigueroa / Ast.java
Last active December 22, 2015 02:09
Sample AST implementation for Compilers course at Galileo University (2013).
package compiler.ast;
import java.io.*;
import compiler.parser.*;
import compiler.lib.*;
import org.antlr.v4.runtime.tree.*;
public class Ast{