Skip to content

Instantly share code, notes, and snippets.

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.8.8"
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
<?php
// Vendor includes
include $config->base_path . '/libraries/Vendor/autoload.php';
// Include configuration file
$config = include('../config.php');
// Create IoC container
$ioc = new \Illuminate\Container\Container;
<?php
// streamed - Macro for streamed responses with seeking support
Response::macro('streamed', function($type, $size, $name, $callback) {
$offset = 0;
$length = $size;
$status = 200;
$headers = [
'Content-Type' => $type,
<?php
namespace LiteCQRS;
/**
* Utility functions
*/
class Util
{
/**
<?php
use App;
use Log;
class InsertNewBookLogger {
public function log(Request $request) {
if (App::environment('local'))
{
<!DOCTYPE html>
<html>
<head>
<link href="http://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src="http://www.jawish.org/blog/uploads/jquery.gdocsviewer.min.js"></script>
<!-- <script src="http://www.jawish.org/blog/uploads/jquery.zohoviewer.min.js"></script> -->
<meta charset="utf-8">
// Demo using DHCP and DNS to perform a web client request.
// 2011-06-08 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
#include <EtherCard.h>
// ethernet interface mac address, must be unique on the LAN
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
static byte myip[] = { 10,0,0,36 };
static byte mymask[] = { 255,255,255,0 };
static byte gwip[] = { 10,0,0,100 };
@hardevine
hardevine / artisan-command.php
Created July 20, 2014 09:38
enable ANSI colors in artisan commands forcefully
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class TestCommand extends Command {
/**
* The console command name.
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
alias h='history'
alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T'