Skip to content

Instantly share code, notes, and snippets.

@mndambuki
mndambuki / eloquent-cheatsheet.php
Created April 25, 2016 07:23 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@mndambuki
mndambuki / class.database.php
Last active September 16, 2015 07:52 — forked from vincentwansink/class.database.php
Database class based on Philip Brown's tutorial at http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
<?php
// Define database configuration
define("DB_HOST", $dblocation);
define("DB_USER", $dbusername);
define("DB_PASS", $dbpassword);
define("DB_NAME", $dbname);
class Database{
private $host = DB_HOST;
@mndambuki
mndambuki / PDO PHP Class
Last active September 16, 2015 07:52 — forked from geoffreyhale/PDO PHP Class
Roll Your Own PDO PHP Class
<?php
/**
* http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
*/
?>
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
The swap-window command is closest to what you want.
"Prefix :" (that is "Ctrl-B :" by default) brings you to the tmux-command prompt. There you enter:
swap-window -s 3 -t 1
to let window number 3 and window number 1 swap their positions.
To swap the current window with the top window, do:
swap-window -t 0
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh