Skip to content

Instantly share code, notes, and snippets.

View kennym's full-sized avatar

Kenny Meyer kennym

View GitHub Profile
@kennym
kennym / gist:769910
Created January 7, 2011 18:49
I cannot see why inner_table is not being rendered...
From 659677d234dced2f0f7f012bfda434a0689cab13 Mon Sep 17 00:00:00 2001
From: Kenny Meyer <knny.myer@gmail.com>
Date: Wed, 5 Jan 2011 17:04:19 -0300
Subject: [PATCH] Implement pagination for cluster detail -> virtual machines
---
ganeti/templates/virtual_machine/inner_table.html | 138 +++++++++++++++++++++
ganeti/templates/virtual_machine/list.html | 4 +-
ganeti/templates/virtual_machine/table.html | 83 +------------
ganeti/urls.py | 3 +
@kennym
kennym / blogspot_to_jekyll.rb
Created July 30, 2011 18:14
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
source 'http://rubygems.org'
gem 'rails', '3.1.0rc5'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'delayed_job'
gem 'ideone-ruby-api'
debug: searching for replacements for wanderlust
debug: searching for replacements for wanderlust
debug: searching for replacements for wavpack
debug: searching for replacements for webcamstudio
debug: searching for replacements for webcamstudio
debug: searching for replacements for webcamstudio
debug: searching for replacements for webcamstudio
debug: searching for replacements for webcamstudio
debug: searching for replacements for whois
debug: searching for replacements for wine
import sys
# Get word list here: https://www.facebook.com/jobs_puzzles/twl06.txt
VALID_WORD_LIST_FILE = "twl06.txt"
def main():
try:
input_phrase = sys.argv[1]
except Exception, e:
print "Get yourself fixed."
#!/bin/sh
# Lee el nombre de un archivo como primer argumento
for i in `more $1 `
do
# Generar un nuevo pass con `pwgen`
pass=`pwgen -1 -N 1`
# Cambiar contrasenha
echo $pass|passwd $i --stdin > /dev/null
# Imprimir usuario y pass
@kennym
kennym / README
Created March 11, 2012 20:07
Secret Santa solution
http://www.rubyquiz.com/quiz2.html
@kennym
kennym / SampleController.rb
Created March 23, 2012 02:05
Sencha Touch JSON-P and Ruby on Rails
class SampleController < ApplicationController
respond_to :json
def index
@nodes = Node.all
render :json => @nodes.to_json, :callback => params[:callback]
end
end
@kennym
kennym / homefinder.rb
Created March 30, 2012 21:03
Clasipar Home finder
# Licensed under DO-WHATEVER-THE-FUCK-YOU-WANT-WITH-THIS-CODE license.
# Self-explanatory.
# What this script does:
#
# 1. Request clasipar.com section inmuebles alquiler in Asuncion
# 2. Parse request
# 3. Parse all 'clasificados'
# 4. Write them to a file, and append new ones to the top.
#
@kennym
kennym / indexer.php
Created April 4, 2012 12:00
Elastic Search indexer
<?php
/*
1. Connect to database.
2. Fetch 100 records from database.
3. Make curl PUT request to Elastic Search server
*/
$DB_NAME = "abc";
$DB_SCHEMA = "";
$DB_TABLE = "";