Skip to content

Instantly share code, notes, and snippets.

javascript:(function () {
var ip_address = prompt('IP Address');
var livereload = document.createElement('script');
livereload.src = "http://" + ip_address + ":35729/livereload.js?ext=Chrome&extver=2.0.9";
document.getElementsByTagName('head')[0].appendChild(livereload);
})();
<a href="#" data-model="Table" data-action="add_row" data-param="">Add row</a>
<a href="#" data-model="Table" data-action="delete_row" data-param='{"id": 1}'>Add row</a>
<script>
var Table = {
add_row: function (self, params) {
console.error('adding_row');
},
<?php
// model
public function paginate($page = 1, $order = [], $limit = 10)
{
// default values
$order = ($order) ?: [];
$limit = ($limit) ?: 10;
$query = $this->product->take($limit);
<?php
class Object
{
public static function property($object, $property)
{
if (! property_exists($object, $property)) {
return null;
}
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var jade = require('gulp-jade');
var jeet = require('jeet');
var rupture = require('rupture')
var path = {
views: './app/*.jade',
styles: './app/stylus/*.styl'
};
@jaggy
jaggy / json_editor.css
Last active August 8, 2016 16:21
My JSON Editor theme.
* {
font-family: 'Operator Mono', 'Inconsolata-dz for Powerline', 'Fira Code', Monaco !important;
}
html {
background: rgb(12, 26, 33);
color: rgba(200, 169, 111, 1);
}
@jaggy
jaggy / csstyle.styl
Created March 17, 2015 07:39
My --csstyle micro port
component(name) {
.{name} {
{block}
}
}
part(name) {
&__{name} {
{block}
<?php
namespace App;
use ReflectionClass;
trait RecordsActivity
{
public static $_recordableEvents;
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@jaggy
jaggy / Mock.php
Last active September 9, 2015 08:11
<?php
class Mock
{
/**
* Full path of the class name to mock.
*
* @var string
*/
protected $class;