Skip to content

Instantly share code, notes, and snippets.

View rodolfo42's full-sized avatar
🎧

Rodolfo Ferreira rodolfo42

🎧
View GitHub Profile
@rodolfo42
rodolfo42 / deleteall.rb
Last active December 17, 2015 14:29
Deletes all objects in a S3 bucket, so you can finally delete it
# Deletes all objects in a S3 bucket, so you can finally delete it
# inspired by
# http://stackoverflow.com/a/1179190
require 'aws'
require 'yaml'
credentials = {
:access_key_id => 'YOUR_ACCESS_KEY_ID',
:secret_access_key => 'YOUR_SECRET_ACCESS_KEY'
@furf
furf / _.deep.js
Created July 30, 2012 17:06
underscore.js mixin for plucking nested properties
_.mixin({
// Get/set the value of a nested property
deep: function (obj, key, value) {
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'),
root,
i = 0,
n = keys.length;
@bkimble
bkimble / gist:1365005
Last active March 22, 2024 19:21
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []