Skip to content

Instantly share code, notes, and snippets.

View allolex's full-sized avatar
🏠
Working from home

Damon Davison allolex

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am allolex on github.
  • I am curatur (https://keybase.io/curatur) on keybase.
  • I have a public key whose fingerprint is 989B 269F C757 96D9 5229 EF55 140D 40DF 74BB D7B3

To claim this, I am signing this object:

@allolex
allolex / serialising_deserialising_structs.rb
Created April 14, 2014 15:04
Example of how to serialise and deserialise Structs in Ruby using the Standard Library
#!/usr/bin/env ruby
require 'json'
require 'json/add/struct'
require 'awesome_print'
Serial = Struct.new(:foo, :bar, :baz)
s = Serial.new('this','that','the other')
puts 'The Struct instance'
ap s
@allolex
allolex / README.md
Last active August 29, 2015 14:00
Regular expression examples
@allolex
allolex / pattern_rename.bash
Created May 15, 2014 15:30
A simple script for renaming files using a sed regular expression pattern
#!/usr/bin/env bash
#
# Usage:
# pattern_rename "SED_PATTERN" "FILE_GLOB"
#
# Example:
# pattern_rename.bash 's/^Youtube - //' "*"
#
# Don't forget to put your file glob in quotes.
@allolex
allolex / oldParser.js
Created May 26, 2014 01:14
A javascript screen form parser I wrote in 2002. lol
function SplitIt(macsplit) {
var temp = new Array();
var reversed = new Array();
var re_macsplit = /[A-F0-9]/;
var j = 0;
for (var i = 0; i < macsplit.length; i++) { // Loop through whole MAC ID string
if (re_macsplit.test(macsplit[i])) { // Match to hexidecimal number regexp
temp[j] = macsplit[i]; // Assign number to the array item
@allolex
allolex / backup_mysql.bash
Created May 28, 2014 18:15
Bash wrapper around ssh and mysqldump to back up remote MySQL databases
#!/usr/bin/env bash
# Usage in new_script.bash
# source /path/to/backup_mysql.bash
# backup_mysql your_host host_ip user password
function backup_mysql () {
REMOTE_HOST_NAME=$1
REMOTE_IP=$2

Rails Girls South Florida Code of Conduct

Rails Girls South Florida is open to everyone. We are committed to providing a friendly, safe, and welcoming environment for all.

All event participants are expected to act in a way that will foster a safe and positive event experience for everyone during the event and at affiliated social events. Conference participants are expected to:

  • Be considerate, respectful, and collaborative.
@allolex
allolex / ruby_shops_incomplete.md
Last active August 29, 2015 14:02
@allolex's list of Ruby Shops, incomplete
@allolex
allolex / tweet_worldcup_flags.rb
Created June 10, 2014 18:32
Tweet the World Cup teams and their flags
#!/usr/bin/env ruby
codes = DATA.readlines
while !codes.empty?
chunk = codes.shift(4)
section = {}
chunk.each do |line|
team, code = line.chomp.split(/\t/)
#!/usr/bin/env ruby
text = '1,2 3-4,5-6 7,8-9 10-11,12 13 14 1516 17,18'
number_or_range = /\d+(?:-\d+)?/
puts text.scan(/#{number_or_range},#{number_or_range}/)