Skip to content

Instantly share code, notes, and snippets.

@chan-grammer
chan-grammer / install_mysql.sh
Created March 20, 2016 03:22 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@chan-grammer
chan-grammer / git_tricks_and_gotcahs.md
Last active August 29, 2015 14:19
Some of git's unexpected behaviour

List of Git Tricks and Gotchas

List of tricks

  • To un-apply git stash git stash show -p stash@{index} | git apply -R --index

These lists some links to some of Git's unexpected behaviours.

exports.ext = function () {
var extTypes = {
"3gp" : "video/3gpp"
, "a" : "application/octet-stream"
, "ai" : "application/postscript"
, "aif" : "audio/x-aiff"
, "aiff" : "audio/x-aiff"
, "asc" : "application/pgp-signature"
, "asf" : "video/x-ms-asf"
, "asm" : "text/x-asm"
@chan-grammer
chan-grammer / SassMeister-input.scss
Last active August 29, 2015 14:06
Generated by SassMeister.com.
// ----
// Sass (v3.4.3)
// Compass (v1.0.1)
// Scut (v1.0.1)
// ----
@import "scut";
@mixin header_sizes($multiplier: 1.125, $line-height-multiplier: 1.5, $font-size: 16px, $rel: false, $rhythm: false) {
@chan-grammer
chan-grammer / SassMeister-input.scss
Created August 2, 2014 13:41
Generated by SassMeister.com.
// ----
// Sass (v3.3.12)
// Compass (v1.0.0.alpha.21)
// Breakpoint (v2.4.6)
// Susy (v2.1.3)
// ----
@import "susy";
@import "breakpoint";
@chan-grammer
chan-grammer / SassMeister-input-HTML.html
Created August 2, 2014 11:43
Generated by SassMeister.com.
<ul class="main-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Awards</a></li>
</ul>
<ul class="sidebar-nav">
<li><a href="#">Home</a></li>
RVM home page: http://rvm.beginrescueend.com
Install RVM
------------
See http://rvm.beginrescueend.com/rvm/install/
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Install rvm for all users
# SCREENSHOT EXAMPLE: http://grab.by/bzg3
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';