This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.9.1/ember.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.0.0-beta.14.1/ember-data.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inspired by http://stackoverflow.com/a/6033994 | |
// for better visual performance hide fading elements via css not via js | |
$.fn.fadeAlternately = function (options) { | |
var options = options || {}; | |
var defaults = { | |
timeOn: 500, | |
timeOff:100, | |
fadeInSpeed:1500, | |
fadeOutSpeed:1500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get (url, callback) { | |
var request = new XMLHttpRequest(); | |
request.onreadystatechange = function () { | |
if (request.readyState == 4 && request.status == 200) | |
callback(request.responseText) | |
} | |
request.open('GET', url, true) | |
request.send() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('socket', function ($rootScope) { | |
var socket = io.connect(); | |
return { | |
on: function(event, callback) { | |
socket.on(event, function () { | |
var args = arguments; | |
$rootScope.$apply(function () { | |
callback.apply(socket, args); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB::listen(function($sql, $bindings) { | |
$sql = str_replace(['%', '?'], ['%%', '%s'], $sql); | |
var_dump(vsprintf($sql, $bindings)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Middleware; | |
use App\Movie; | |
use Carbon\Carbon; | |
use Closure; | |
use Illuminate\Http\Response; | |
use Illuminate\Session\Store; | |
class CountMovieVisits { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias c="composer" | |
alias ccp="composer create-project --prefer-dist" | |
alias csu="sudo composer self-update" | |
alias cu="composer update" | |
alias ci="composer install" | |
alias cr="composer require" | |
alias csh="composer show" | |
alias cse="composer search" | |
alias cda="composer dump-autoload -o" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $(id -u) -ne 0 ]] | |
then echo "Script requires sudo!" | |
exit 1 | |
fi | |
add-apt-repository ppa:ondrej/php5 | |
add-apt-repository ppa:ondrej/mysql-5.6 | |
apt-get update |
NewerOlder