Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
for volumeName in $(ec2-describe-volumes --region us-west-2 | grep VOLUME | grep available | awk '{print $2}'); do
ec2-delete-volume $volumeName --region us-west-2
done
@pedrogimenez
pedrogimenez / gist:4959827
Last active May 7, 2017 05:51
Fix for the "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError) problem in Ruby 1.9.3
file = File.open(path, 'r:UTF-8')
@pedrogimenez
pedrogimenez / uninstall all installed gems
Last active December 13, 2015 22:49
script to uninstall all installed gems
#!/bin/sh
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
@pedrogimenez
pedrogimenez / gist:5611715
Created May 20, 2013 11:27
Vertical and horizontal centering an element with unknown size
.centered {
background-color: red;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@pedrogimenez
pedrogimenez / gist:5990953
Created July 13, 2013 14:44
cool text-shadow
text-shadow: -3px 0 0 hsla(191, 100%, 50%, .3), 3px 0 0 hsla(20, 100%, 30%, .3)
@pedrogimenez
pedrogimenez / stringcalculator.rb
Last active September 23, 2019 20:39
string calculator
module StringCalculator
extend self
DELIMITERS = ["\n", ","]
DELIMITER_MARK = '//'
def add(string)
numbers = extract_numbers(string)
assert_not_negatives(numbers)
total(numbers)
@pedrogimenez
pedrogimenez / Gemfile
Last active December 31, 2015 18:59 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", "~> 0.10.0"
gem "pg"
gem "thin"
@pedrogimenez
pedrogimenez / Gemfile
Created December 27, 2013 17:44 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"
@pedrogimenez
pedrogimenez / iOS developer.md
Created April 22, 2014 10:56
iOS developer.md

Chicisimo is looking for an iOS developer

Remote work (or based in Valencia)

What's Chicisimo?

Chicisimo is a player in the social fashion space, and we are building tools to help girls decide what to wear.

We serve an amazing community of fashion enthusiasts who spend up to 1 hour a week on our site, with engagement ratios growing 30% month over month.

We have worldclass media and ecommerce partners, and have been featured on both fashion and tech press. Also, we are lucky to have amazing investors.

@pedrogimenez
pedrogimenez / swift.swift
Last active February 9, 2017 07:27
swift.swift
func calculateAverage(total: Int, countOfNumbers: Int) -> Int {
return total / countOfNumbers
}
func average(algorithm: (Int, Int) -> Int, numbers: Int...) -> Int {
var countOfNumbers = 0
var total = 0
for number in numbers {
total += number