Skip to content

Instantly share code, notes, and snippets.

(function ($) {
$.event.special.textchange = {
setup: function (data, namespaces) {
$(this).bind('keyup', $.event.special.textchange.handler);
$(this).bind('cut paste input', $.event.special.textchange.delayedHandler);
},
teardown: function (namespaces) {
<?php
/**
* AutoHelperView
* Provides automatic helper loading for views.
*
* @author Joe Beeson <jbeeson@gmail.com>
*/
class AutoHelperView extends View {
@parweb
parweb / contain-floats.css
Created April 26, 2011 15:45 — forked from necolas/contain-floats.css
Cross-browser, consistent float-containment methods
/*
* Containing floats in a consistent manner
* By Jonathan Neal and Nicolas Gallagher
*/
/*
* New block formatting context method
* IE 6+, Firefox 2+, Safari 4+, Opera 9+, Chrome
*/
@parweb
parweb / designer.html
Created July 28, 2014 16:45
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
@parweb
parweb / gist:d933efbf0d7334a79ef9
Last active August 29, 2015 14:20
Tag <a> with any method type for laravel
/*
* Utilisation:
*
* add this in your body tag
* <body data-token="{{ csrf_token() }}">
*
* and enjoy ( that should change the world ^^ )
*
* <a method="delete" href="{{ route( 'users.destroy', $user_id ) }}">Delete a user</a>
* <a method="put" data-items='{ "title" : {{ $mynewtitle }} }' href="{{ route( 'post.update', $post_id ) }}">change the title</a>
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCouponsTable extends Migration
{
public function up()
{
Schema::create('coupons', function (Blueprint $table) {
@parweb
parweb / gist:08dd8a299d7f8d7860dc
Created January 8, 2016 21:54
Verifying that +parweb is my blockchain ID. https://onename.com/parweb
Verifying that +parweb is my blockchain ID. https://onename.com/parweb
@parweb
parweb / DataLoader.php
Last active July 17, 2016 01:22
Facebook/DataLoader for the PHP communauty on top of Icicle
<?php
namespace App\hissezhaut\DataLoader;
use App\hissezhaut\DataLoader\Types\Map;
use App\hissezhaut\DataLoader\Types\Options;
use App\hissezhaut\DataLoader\Types\Queue;
use Exception;
use Icicle\Awaitable as UPromise;
use Icicle\Awaitable\Promise;
@parweb
parweb / variadic-generics.php
Created October 13, 2016 20:58 — forked from ramsey/variadic-generics.php
You may type-hint on variadic functions in PHP to enforce type on elements in the array
<?php
class Foo {}
$f1 = new Foo();
$f2 = new Foo();
$bar = function (Foo ...$foo) {
foreach ($foo as $f) {
echo get_class($f) . "\n";
}
@parweb
parweb / input.php
Last active November 22, 2016 16:14
Do you know a better way ?
<?php
$input = array(
'data' => array(
'vehicles' => array(
0 => array(
'id' => '782',
'vin' => 'VF7SA9HD8DW660669',
'equipments' => array(
0 => array(