Skip to content

Instantly share code, notes, and snippets.

View fideloper's full-sized avatar
🏠
Working from home

Chris Fidao fideloper

🏠
Working from home
View GitHub Profile
@fideloper
fideloper / pubsub.js
Created May 3, 2012 19:39
PubSub Example
/*
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
*************************************************************/
@fideloper
fideloper / git_count.sh
Created May 9, 2012 02:27
Grab Git commands from bash history and report their usage count
#!/bin/bash
# Grab Git commands from bash history and report their usage count
#First Iteration
#cat ~/.bash_history | grep git | sort | uniq -c | sort -r
#Second Iteration
function show_usage {
@fideloper
fideloper / mysql.backup-alt.sh
Last active October 4, 2015 13:58
Bash Shell for backing up database and copying it to remote location
#!/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
@fideloper
fideloper / no_more_msm.php
Created May 10, 2012 13:36 — forked from amacneil/no_more_msm.php
Extract a single ExpressionEngine site from a MSM install
<?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
<?php
function _get_plugin_info($filename = '')
{
if ( ! $filename)
{
return FALSE;
}
$path = PATH_PI.'pi.'.$filename.'.php';
@fideloper
fideloper / site.backup.sh
Created May 15, 2012 20:14
Backup whm account files and database
#!/bin/bash
#Show instructions
function show_usage {
echo "Backup account and database, assuming /home/USER filesystem setup."
echo "Usage:"
echo " -h Help menu - See this information"
echo " Files: "
echo " -a Account user name, for use in /home/USER backup. If no path is set via -p flag, the /home/USER path will be backed up. "
echo " -f Filepath to Backup "
@fideloper
fideloper / bookmarket.js
Created May 15, 2012 21:02
Bookmarklet Skeleton JS
(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();
@fideloper
fideloper / vhost.py
Last active January 25, 2024 23:37
Create vHost Ubuntu Lamp-Server (bash and python)
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@fideloper
fideloper / usevm.md
Created June 6, 2012 02:24
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

@fideloper
fideloper / h.sh
Created June 16, 2012 15:51
Shortcut for searching bash history using grep
#! /bin/bash
function show_usage {
cat <<- _EOF_
Search Bash History using Grep
Examples:
$ h ssh
$ h 'ssh user@'