Skip to content

Instantly share code, notes, and snippets.

View weotch's full-sized avatar
👋
Heya

Robert Reinhard weotch

👋
Heya
View GitHub Profile
@weotch
weotch / gist:04709761d4accd60b894591a336e784d
Last active November 21, 2016 23:21 — forked from samnang/gist:1759336
Install Bash version 4 on MacOS X
# Install Bash 4 using homebrew
brew install bash
# Add the new shell to the list of legit shells
sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"
# Change the shell for the user
chsh -s /usr/local/bin/bash
# Restart terminal.app (new window works too)
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHistoriesTable extends Migration {
/**
* Run the migrations.
*
@weotch
weotch / gist.php
Last active February 23, 2016 19:18 — forked from anonymous/gist.php
<?php
Route::get('guidelines/{slug}/{page}', ['as' => 'guideline-page', function($slug, $page) {
$guideline = Guideline::findBySlugOrFail($slug);
$page = $guideline->guidelineBlocks()->where('slug', $page)->firstOrFail();
// previous pages
$previous = $guideline->guidelineBlocks()
->where('guideline_blocks.position', '<', $page->position)
->orderBy('guideline_blocks.position', 'desc')
var root = this;
(function( jQuery ) {
if ( root.XDomainRequest ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;
}
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ProductImagesTable extends Migration {
/**
* Run the migrations.
*
<?php
// Homepage feed
public function index($filter = null) {
// Tell Laravel where to find the mustache views for post
app('view')->addNamespace('js', public_path().'/js');
// Render the view
$this->layout->nest('content', 'gadget.index', array(