Skip to content

Instantly share code, notes, and snippets.

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

Manny Isles mannysoft

🏠
Working from home
View GitHub Profile

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@mannysoft
mannysoft / BaseModel.php
Last active August 29, 2015 14:05
BaseModel.php
<?php
use Illuminate\Database\Eloquent\Model as Eloquent;
class BaseModel extends Eloquent{
public $errors;
public $validation;
public $rawErrors;
public $customRule;
<?php
class BaseController extends Controller {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
<?php
class DataCreator{
protected $listener;
protected $department;
protected $redirectPage;
public function __construct($listener, $model = '', $redirectPage = '', $labels = array())
{
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
### Install OpenJDK
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.deb
sudo dpkg -i elasticsearch-1.4.0.deb
<?php
class Test extends Controller
{
function test()
{
$user = new User();
$user->fill(Input::all());
$user->customRule = 1;
$user->save();
#!/usr/bin/env bash
# wget script from gist
# curl -LO https://gist.githubusercontent.com/mannysoft/fc6430c6b886dae149b6/raw/eb079e5cacc459b7a7a98ac073daa6be995c50f6/install-packages.sh
# chmod +x install-packages.sh
# ./install-packages.sh
echo "--- Welcome User. This is very exciting. ---"
echo "--- Updating packages list ---"
sudo apt-get update
sudo apt-get upgrade
@mannysoft
mannysoft / eloquent.php
Last active December 10, 2015 09:58
Using Eloquent outside of Laravel 4. gist from https://gist.github.com/4234104
<?php
require 'vendor/autoload.php';
$resolver = new Illuminate\Database\ConnectionResolver;
$resolver->setDefaultConnection('default');
$factory = new Illuminate\Database\Connectors\ConnectionFactory;
$connection = $factory->make(array(
'host' => 'localhost',
'database' => 'database',
{
"require": {
"php": ">=5.3.0",
"illuminate/database": "dev-master"
},
"autoload": {
"classmap": [