Skip to content

Instantly share code, notes, and snippets.

Christian Genco christiangenco

Block or report user

Report or block christiangenco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View download_egghead_videos.md
@christiangenco
christiangenco / bitcoin_address_validator.rb
Last active Jan 2, 2016 — forked from alexandrz/bitcoin_address_validator.rb
Simple Rails bitcoin address validation. Doesn't calculate the checksum or anything fancy - just checks that the address starts with a 1 or 3, consists only of alphanumeric characters, and is 27-34 characters long (from https://en.bitcoin.it/wiki/Address).
View bitcoin_address_validator.rb
class User < ActiveRecord::Base
validates :bitcoin_address, format: { with: /\A(1|3)[a-zA-Z1-9]{26,33}\z/,
message: "invalid bitcoin address" }
end
@christiangenco
christiangenco / videos.js
Created Mar 28, 2012 — forked from csabapalfi/videos.js
Download and Organize Coursera videos
View videos.js
$("h3.list_header").each(function(sectionIndex){
var sectionName = $(this).text().replace(/Chapter .+ - /,"").replace(/\:/,'-').replace(/^(V|I|X)+\. /,'');
$(this).parent().next().find("a.lecture-link").each(function(videoIndex){
var $lectureLink = $(this);
var videoName = $.trim($lectureLink.text());
var downloadLink = $lectureLink.attr('href').replace('view','download.mp4');
var cookieHeader = ' --header \"Cookie:'+ document.cookie + '\" ';
var directory = (sectionIndex+1) + '. ' + sectionName + '/';
var filename = directory + (videoIndex+1) + '. ' + videoName + '.mp4';
You can’t perform that action at this time.