Skip to content

Instantly share code, notes, and snippets.

View dannykopping's full-sized avatar

Danny Kopping dannykopping

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<databases>
<from>
<host>localhost</host>
<username>flexologist</username>
<password>flexologist</password>
<database>flexologist_migration_from</database>
</from>
CREATE DATABASE `flexologist_migration_from` ;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`age` int(3) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
CREATE USER 'flexologist'@'localhost' IDENTIFIED BY '***';
GRANT ALL PRIVILEGES ON * . * TO 'flexologist'@'localhost' IDENTIFIED BY '***' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT ALL PRIVILEGES ON `flexologist\_%` . * TO 'flexologist'@'localhost';
$migration = new Migration();
$migration->migrate();
$migration->closeConnections();
var accessors:XMLList = describeType(Capabilities)..accessor.(@declaredBy == getQualifiedClassName(Capabilities));
for each(var accessor:XML in accessors)
trace(accessor.@name.toString() + ": " + Capabilities[accessor.@name.toString()]);
@dannykopping
dannykopping / xmlToObject.as
Created November 5, 2010 22:18
Deserialize XML to an Object instance
private function xmlToObject(xml:XML, chain:Object=null):Object
{
if(!chain)
chain = {};
for each(var child:XML in xml.children())
{
(child.children().length() > 1 || (child.children().length() == 1 && child.hasComplexContent()))
? chain[child.name().toString()] = xmlToObject(child, chain[child.name().toString()])
: chain[child.name().toString()] = chain[child.name().toString()] = child.text().toString();
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="amfphp"/>
</channels>
<properties>
<mx:RemoteObject id="service" destination="amfphp" source="MyService" result="result(event)" fault="fault(event)"/>
@dannykopping
dannykopping / merger.php
Created August 2, 2011 23:35
Merge audio and video FLV scripts with PHP and FFMPEG
<?php
$streamsPath = realpath("/usr/share/red5/webapps/vod/streams");
$videoFile = "$streamsPath/356a192b7913b04c54574d18c28d46e6395428ab-1312327917237_Video.flv";
$audioFile = "$streamsPath/356a192b7913b04c54574d18c28d46e6395428ab-1312327917237_Audio.flv";
// convert audio FLV to mp3
$targetAudio = dirname(realpath($audioFile))."/audio.mp3";
system("ffmpeg -y -i $audioFile -ac 2 -ab 128kb $targetAudio");
@dannykopping
dannykopping / error
Created August 20, 2011 12:13
Git Clone error
$ git clone git@github.com:dannykopping/Dwarf.git --progress
Cloning into Dwarf...
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the re
mote side.remote: error: Could not read fa2328373fb5a73ec44fd5f7f862e1fe3aea6c0e
remote: fatal: bad tree object fa2328373fb5a73ec44fd5f7f862e1fe3aea6c0e
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed