Skip to content

Instantly share code, notes, and snippets.

View zmax's full-sized avatar
🇹🇼

Starck Lin zmax

🇹🇼
View GitHub Profile
@zmax
zmax / gist:5279571
Last active December 15, 2015 15:09
Parsing Github Fenced code blocks
Route::get('/regtest', function(){
$test = '
```php
use Namespace1\Namespace2\Namespace3;
class Article extends Model
{
public function identifiableName()
@zmax
zmax / gist:5306517
Created April 3, 2013 23:48
取得網頁捲動的y軸座標
var getScrollTop = function () {
return win.pageYOffset || doc.compatMode === "CSS1Compat" && doc.documentElement.scrollTop || doc.body.scrollTop || 0;
};
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
namespace {
die('Only to be used as an helper for your IDE');
}
@zmax
zmax / _ide_helper.php
Created June 17, 2013 08:18
Laravel CodeIntel IDE helper
<?php die("Access denied!");
/**
* ---------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ------------------------
* Laravel IDE Helper <http://LaravelBook.com>
* Implements code completion for Laravel 4 in JetBrains PhpStorm and SublimeText 2
* --------------------------------------------------------------------------------
*/
/**
* @var static void strength Hash strength.
@zmax
zmax / ie8-grid-foundation-4.css
Created June 17, 2013 08:25 — forked from hatefulcrawdad/ie8-grid-foundation-4.css
Foundation 4 Grid hack for IE8
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@zmax
zmax / laravel-service-provider-register-sample.php
Created June 18, 2013 20:39
Laravel ServiceProvider register()
$this->app['package.key'] = $this->app->share( function($app) {
return;
});
@zmax
zmax / llsp.sublime-snippet
Created June 22, 2013 17:01
sublime laravel service provider template
<snippet>
<content><![CDATA[
namespace ${1:vendor}\\${2:package}
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\App;
class ${2:package}ServiceProvider extends ServiceProvider {
/**
@zmax
zmax / llcmd.sublime-snippet
Created June 22, 2013 17:10
sublime laravel custom command template
<snippet>
<content><![CDATA[
namespace ${1:Vendor}\\${2:Package};
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ${2:Package}CreatorCommand extends Command {
@zmax
zmax / mvim
Created June 30, 2013 09:13
MacVim Script
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
@zmax
zmax / EventUtil.js
Last active December 20, 2015 12:18
EventUtil
var EventUtil = {
addHandler: function(element, type, handler) {
if (element.addEventListener) {
element.addEventListener(type, handler, false);
} else if ( element.attachEvent ) {
element.attachEvent("on" + type, handler);
} else {
element["on"+type] = handler;
}