Skip to content

Instantly share code, notes, and snippets.

View gilbitron's full-sized avatar

Gilbert Pellegrom gilbitron

View GitHub Profile
@gilbitron
gilbitron / PhpValetDriver.php
Last active May 24, 2017 11:56
A generic PHP driver for Laravel Valet
<?php
class PhpValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@gilbitron
gilbitron / wp-install-core-sub-dir.sh
Last active August 29, 2015 14:25 — forked from polevaultweb/wp-install-core-sub-dir.sh
This script installs WordPress inside a sub directory
#!/bin/bash
# Installation:
# Install the script in one of the folders in your PATH. Make sure it has execute permissions (i.e. chmod +x wp-install-core-sub-dir).
#Usage:
# $ mkdir mysite
# $ cd mysite
@gilbitron
gilbitron / .bash_profile
Last active January 15, 2019 11:39
Mac OS X Bash Profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@gilbitron
gilbitron / wordpress.posts.50k.xml
Last active August 29, 2015 14:22
WordPress 50k posts export for testing purposes
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
@gilbitron
gilbitron / u.data.tmdb
Created June 25, 2014 10:08
MovieLens 100k dataset with TMDB IDs http://grouplens.org/datasets/movielens
This file has been truncated, but you can view the full file.
196 784 3 881250949
186 2118 3 891717742
22 14819 1 878887116
244 4476 2 880606923
166 184 1 886397596
298 935 4 884182806
115 1669 2 881171488
253 183407 5 891628467
305 621 3 886324817
6 1245 3 883603013
@gilbitron
gilbitron / PostDeploy.php
Last active December 5, 2016 19:06
Laravel Post Deployment Command
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
/**
* Laravel Post Deployment Command
* Author: Gilbert Pellegrom (http://gilbert.pellegrom.me)
* License: MIT
@gilbitron
gilbitron / Gruntfile.js
Last active January 4, 2016 16:49
Sample Gruntfile.js for Dunked.com
module.exports = function(grunt) {
// Config
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
scripts: {
files: {
'assets/dist/dunked-scripts-before.min.js': [
@gilbitron
gilbitron / wp-updates-theme.php
Created September 4, 2012 14:12
WPUpdates Theme Updater Class (with Envato API verification)
<?php
/*
WPUpdates Theme Updater Class (with Envato API verification)
http://wp-updates.com
v1.1
Example Usage:
require_once('wp-updates-theme.php');
new WPUpdatesThemeUpdater( 'http://wp-updates.com/api/1/theme', 1, basename(get_template_directory()) );
*/
class WPSFTest {
private $plugin_path;
private $wpsf;
function __construct()
{
$this->plugin_path = plugin_dir_path( __FILE__ );
// Include and create a new WordPressSettingsFramework