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 / 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
@fideloper
fideloper / MongoDB Backup Script
Created September 28, 2012 21:35 — forked from wahyusumartha/MongoDB Backup Script
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
# 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 October 4, 2018 05:54 — forked from anonymous/testable_user.php
An example of making a User class testable and maintainable, using dependency injection and some abstraction.
<?php
// Often, we see a class like this:
class User {
public function getCurrentUser()
{
$user_id = $_SESSION['user_id'];
$user = App::db->select('user')
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
# 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