Skip to content

Instantly share code, notes, and snippets.

@ugoletti
ugoletti / MySql2Sqlite.php
Created January 30, 2011 23:01
MySql2Sqlite
#!/usr/bin/php
<?php
showMessage( "MySql2Sqlite v1.0" );
showMessage( "by Daniele Ugoletti" );
showMessage( "-------------------" );
// check the arguments
if ( $argc < 5)
{
showMessageAndDie( "Usage: ".$argv[ 0 ]." <mysql_host> <mysql_username> <mysql_password> <dbName> [<outSqliteFile] [useUTF8 true|false]" );
@ugoletti
ugoletti / removePHPcomments.sh
Created April 5, 2011 22:49
remove php comments
find . -type f -name "*.php" | while read file; do sed -i -e '/\/\*/,/*\//d; /^[[:space:]]*\/\//d; /^$/d;' $file;done
@ugoletti
ugoletti / CompileHtml.js
Last active December 17, 2015 10:08
AngularJS "Compile Html" directive. Compile a HTML partial loaded from external service.
/*
* $scope.test = 'hello world';
* $scope.content = '<div>{{test | uppercase}}</div>';
*
* <div compile-html="content"></div>
*/
angular.module('directives').directive('compileHtml', function ($compile) {
return function(scope, element, attr) {
var unregister = scope.$watch(attr.compileHtml, function (value) {