Skip to content

Instantly share code, notes, and snippets.

View allejo's full-sized avatar

Vladimir Jimenez allejo

View GitHub Profile
@allejo
allejo / urlFetcher.rb
Last active August 29, 2015 14:06
Read through an HTML file of anchor tags, parse all of the hyperlinks, and download them
#!/usr/bin/ruby
#
# License: Public Domain
line_number = 0;
dry_run = ARGV[1]
if ARGV[0].nil? || ARGV[0].empty?
puts "Usage: ruby urlFetcher.rb [FILE_PATH] [OPTION]"
puts ""
@allejo
allejo / GSoC 2013 - WordPressMigrationAssistant.md
Created April 10, 2013 19:19
Google Summer of Code 2013 - WordPress Migration Assistant

The goal for WordPress’ Migration Assistant will be to aid in migrating any WordPress blog to a new host or simply changing the domain name of a WordPress blog.

The solution to this problem will be to create a user interface to be part of the administrative control panel where the blog admin will be able to migrate the WordPress blog or simply edit the blog URL, which will go through the current database and change the respective fields to contain the new URL. The blog admin will have two options for migration.

  1. The first option will be to provide FTP and MySQL credentials for the new host and the migration assistant will connect to the new host and start transferring Wordpress files, uploads, plug-ins, themes, and the database; provided the connection was successful.

  2. The second option will be to download a zip file containing the exported database and all of the Wordpress files so you can upload to the new web host and extract all the files there. (The option will also be used as a fallback in case t

@allejo
allejo / compress.sh
Last active October 13, 2015 19:18
Minify CSS and JS files in a project
#!/bin/bash
for css_file in css/*
do
if [[ "$css_file" == *".min."* ]]
then
continue
fi
if [[ "$css_file" -nt "${css_file%.*}.min.css" ]]
@allejo
allejo / getTotalLineCount.sh
Created October 30, 2012 01:42
Total Number of Lines of a Given File Type in a Folder
#!/bin/bash
if [ -z "$1" ] # Check if no argument was passed
then
echo "No extension specified."
exit
fi
# If someone passes * as an argument it'll pass all the
# files in the directory as arguments, so we just need