Skip to content

Instantly share code, notes, and snippets.

View apperceive's full-sized avatar

Apperceive apperceive

View GitHub Profile
@opalsignum-snippets
opalsignum-snippets / migrateuserd6d7.php
Created June 27, 2013 08:03
This standalone script migrates Users from Drupal 6 to Drupal 7
<?php
/*
Standalone PHP script to migrate users from Drupal 6 to Drupal 7 programatically.
Date: 9-4-2012
*/
// set HTTP_HOST or drupal will refuse to bootstrap
$_SERVER['HTTP_HOST'] = 'example.org';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
@r10r
r10r / skitch2png.rb
Created May 29, 2012 06:11
Extract PNG data from .skitch SVG files
#!/usr/bin/env ruby
# extracts the embedded PNG data from .skitch SVG files
require 'nokogiri'
require 'base64'
IMAGE_HEADER = "data:image/png;base64,"
ARGV.each do |filename|
svg_document = Nokogiri::XML(File.open(filename))