Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@inakiabt
inakiabt / MemcacheEx.php
Created February 16, 2011 20:12
MemcacheEx - Memcache extension to support setMulti and getMulti methods
<?php
class MemcacheEx extends Memcache
{
public function getMulti($keys)
{
$results = array();
if ($keys) {
foreach ($keys as $key) {
$cache = parent::get($key);
if ($cache !== false) {
// ###########################################################
//
// Demonstrates how to supervise an Akka consumer actor.
//
// The consumer consumes messages from a file endpoint:
// - successful message processing by the consumer will
// positively acknowledge the message receipt, causing
// the file endpoint to delete the file.
// - an exception during message processing will cause a
// supervisor to restart the consumer. Before restart,
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://repository.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@inakiabt
inakiabt / extjs-capture.js
Created March 20, 2012 22:42 — forked from revolunet/extjs-capture.js
ExtJs debug : capture all events
// to capture ALL events use:
Ext.util.Observable.prototype.fireEvent = Ext.Function.createInterceptor(Ext.util.Observable.prototype.fireEvent, function(evt) {
var a=arguments;
console.log(this,' fired event ',evt,' with args ',Array.prototype.slice.call(a,1,a.length));
return true;
});
// to capture events for a particular component:
Ext.util.Observable.capture(
Ext.getCmp('my-comp'),
/**
*
* this code was inspired by the work done by David Riccitelli
*
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@inakiabt
inakiabt / 0_reuse_code.js
Created May 31, 2014 19:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@inakiabt
inakiabt / decode-email.rb
Created July 16, 2014 22:29
Decode raw text/plain email
# gem install mail
require 'rubygems'
require 'mail'
mail = Mail.new(open("body.txt").read)
print mail.text_part.decode_body
@inakiabt
inakiabt / build.sbt
Last active August 29, 2015 14:09 — forked from mumoshu/build.sbt
name := "DES and AES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"
@inakiabt
inakiabt / echoHttpRequest.js
Last active August 29, 2015 14:16 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);