Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Chris Fidao fideloper

🏠
Working from home
Block or report user

Report or block fideloper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fideloper
fideloper / no_more_msm.php
Created May 10, 2012 — forked from amacneil/no_more_msm.php
Extract a single ExpressionEngine site from a MSM install
View no_more_msm.php
<?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
View MongoDB Backup Script
#!/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
View default.rb
# Use PHP 5.4
apt_repository "php54" do
uri "http://ppa.launchpad.net/ondrej/php5/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "E5267A6C"
end
@fideloper
fideloper / User.php
Last active Oct 4, 2018 — forked from anonymous/testable_user.php
An example of making a User class testable and maintainable, using dependency injection and some abstraction.
View User.php
<?php
// Often, we see a class like this:
class User {
public function getCurrentUser()
{
$user_id = $_SESSION['user_id'];
$user = App::db->select('user')
View basic_vagrant.sh
# First, Install Vagrant and Virtualbox then:
# Create new project directory
mkdir -p ~/Sites/newproject # Create new project directory
mk ~/Sites/newproject # Go into your new project directory
# Setup Vagrant
vagrant init
# Edit vagrant file box and box url to install Ubuntu, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L6-L8
# Edit Vagrantfile to create a static IP address, just like https://gist.github.com/fideloper/dab171a2aa646e86b782#file-vagrantfile-share-var-www-rb-L10
You can’t perform that action at this time.