Skip to content

Instantly share code, notes, and snippets.

View vortizhe's full-sized avatar

Victor Ortiz vortizhe

View GitHub Profile
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@vortizhe
vortizhe / fix-srt.rb
Last active August 29, 2015 14:09 — forked from brenes/fix-srt.rb
#! /usr/bin/env ruby
# This small script uses the 'srt' gem to parse the srt file
# It solves problems with certain subtitle files with empty lines that make Flex crash
# You can use it with files, folders with files or even folders with subfolders with files (God bless Recursivity)
# USAGE: ruby fix-srt.rb file/to/fix.srt
# USAGE: ruby fix-srt.rb folder/with/files/to/fix
# USAGE: ruby fix-srt.rb folders/with/subfolders/to/fix
require 'rubygems'
require 'srt'
#!/bin/bash
# Change the iterm2 profile programatically
function iterm_profile {
if [[ -z $1 ]]; then
profile="Default"
else
profile=$1
fi
@vortizhe
vortizhe / default.rb
Created November 27, 2012 20:18 — forked from wilmoore/default.rb
DIY Private Cloud w/ VirtualBox and Chef
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do
@vortizhe
vortizhe / rawclone_bundler.rb
Created November 28, 2011 12:48 — forked from rsierra/rawclone_bundler.rb
Script para generar el Gemfile de bundler a partir de un 'gem list'
#!/usr/bin/env ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
alias branch="git branch 2>/dev/null | grep '*' | sed 's/\* //'"
alias p='git fetch origin && git rebase -p origin/`branch`'
alias pm='git fetch origin && git merge origin/`branch`'
alias P='git push origin `branch`'
@vortizhe
vortizhe / rawclone.rb
Created July 18, 2011 11:28 — forked from littlemove/rawclone.rb
Reads a file with the output from gem list and installs the gems
#! /usr/bin/ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)