Skip to content

Instantly share code, notes, and snippets.

View vicomte's full-sized avatar

Marc Hassman vicomte

  • Scorevision
  • Papillion, NE
View GitHub Profile
@vicomte
vicomte / rackdel.rb
Last active July 24, 2024 15:38
Rackspace Cloud Files - purge by container with Ruby Fog gem
#!/bin/env ruby
# Last used with 3.2.2 - purge a Rackspace cloud files container.
# Put fog-rackspace in your gemfile and run: bundle install && bundle exec ./rackdel.rb <container name>
# limits don't seem to quite work correctly since this will empty your container even past 10_000 items per container??
# oO Definately could be improved.
require 'net/http'
require 'fog/rackspace'
CONNECTION_OPTIONS = {
@vicomte
vicomte / succ.js
Last active December 21, 2015 15:09 — forked from devongovett/succ.js
/*
* An implementation of Ruby's string.succ method.
* By Devon Govett
*
* Returns the successor to str. The successor is calculated by incrementing characters starting
* from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the
* string. Incrementing a digit always results in another digit, and incrementing a letter results in
* another letter of the same case.
*
* If the increment generates a carry, the character to the left of it is incremented. This