This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Turn on Rewrite | |
RewriteEngine On | |
#Check if requested file ends in .md or .markdown | |
RewriteCond $1 \.(md|markdown)$ [NC] | |
#Check if file exists | |
RewriteCond %{REQUEST_FILENAME} -f | |
#Rewrite so $_GET['file'] is available to PHP code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
See it in action: http://jsbin.com/iyinux/edit#javascript,html,live | |
Also Fun: http://jsbin.com/oyanih/7/edit#javascript,html,live | |
Better Fun: http://jsbin.com/uhakaw/34/edit#javascript,html,live | |
*/ | |
/* | |
EXAMPLE USE OF JAVASCRIPT PUBSUB - | |
https://github.com/mroderick/PubSubJS | |
*************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# THIS VERSION WILL ASK YOU FOR THE DATABASE NAME AND WHERE TO SAVE IT LOCALLY | |
function show_usage { | |
echo "Usage: $0 database-name save-directory" | |
exit 1 | |
} | |
#Need two parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Instructions: | |
* First add your database connection details below. | |
* Then either upload this script to your server and visit the page, | |
* or run it using the command line: php no_more_msm.php | |
*/ | |
// database connection details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _get_plugin_info($filename = '') | |
{ | |
if ( ! $filename) | |
{ | |
return FALSE; | |
} | |
$path = PATH_PI.'pi.'.$filename.'.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Namespace = function() { | |
//Private | |
_init = function(jq) { | |
if(!jq) { | |
_getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', _run); | |
return; | |
} | |
_run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
function show_usage { | |
cat <<- _EOF_ | |
Search Bash History using Grep | |
Examples: | |
$ h ssh | |
$ h 'ssh user@' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Reference: http://stackoverflow.com/questions/7600313/find-command-that-returns-line-number-of-the-string | |
find . -name '*.php' -print | xargs grep -Hn 'print_r' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function show_usage { | |
echo "Use to clean .DS_Store and ._* files which macintosh loves to add to your file system." | |
echo "This works recursively" | |
echo "Usage: $ cleanmac /path/of/dir" | |
echo "Defaults to current directory '.' " | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#!/usr/bin/env ruby | |
######################################### | |
# Define source and destinations | |
MONGO_DBS="" | |
BACKUP_TMP=~/tmp | |
BACKUP_DEST=~/backups | |
MONGODUMP_BIN=/Users/wahyusumartha/Documents/mongodb-db/bin/mongodump | |
TAR_BIN=/usr/bin/tar |