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 | |
/** | |
* PHP Regex to validate a Twitter hashtag | |
* | |
* Useful for validating a text input (an HTML form in your CMS or custom application) that must be a valid Twitter hashtag. | |
* Valid examples: #a, #_, #_1, #_a, #1a, #áéìôü, #123hàsh_täg446 | |
* Invalid examples: #1, ##hashtag, #hash-tag, #hash.tag, #hash tag, #hashtag!, (any hashtag that is more than 140 characters long, hash symbol included) | |
* | |
* Regex explanation: | |
* First, the lookahead assertion (?=.{2,140}$) checks the minimum and max length, as explained here http://stackoverflow.com/a/4223213/1441613 |
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
[ | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }, | |
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} }, | |
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }, | |
{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof"} }, | |
{ "keys": ["ctrl+end"], "command": "move_to", "args": {"to": "eof"} }, | |
{ "keys": ["ctrl+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} }, | |
{ "keys": ["ctrl+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} } | |
] |
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
/** | |
* Links | |
*/ | |
body { | |
background: #FFDEDB; | |
} | |
a { | |
display: inline-block; |
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
<snippet> | |
<content><![CDATA[ | |
// ${1} Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
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
/* | |
* Grid Overlay for Twitter Bootstrap | |
* Assumes a 1.692em baseline grid (22px/13px) | |
*/ | |
@media (min-width: 1200px) { | |
body { | |
background: -webkit-gradient(linear, top left, bottom left, color-stop(0%, rgba(0, 0, 0, 0.05)), color-stop(4.545%, rgba(0, 0, 0, 0.05)), color-stop(4.545%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0))), -webkit-gradient(linear, top left, top right, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(35%, rgba(0, 0, 0, 0)), color-stop(35%, rgba(0, 0, 0, 0.05)), color-stop(36%, rgba(0, 0, 0, 0.05)), color-stop(36%, rgba(0, 0, 0, 0)), color-stop(65%, rgba(0, 0, 0, 0)), color-stop(65%, rgba(0, 0, 0, 0.05)), color-stop(66%, rgba(0, 0, 0, 0.05)), color-stop(66%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0))), -webkit-gradient(linear, top left, top right, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(0.085%, rgba(0, 0, 0, 0.1)), color-stop(0.085%, rgba(0, 0, 0, 0))); | |
background: -webkit-linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba( |
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 | |
/** | |
* Base Model | |
* | |
* @package Extends Model Laravel | |
* @version 1.0 | |
* @author Purwandi <free6300@gmail.com> | |
* @link http://purwand.me | |
*/ | |
class Base extends Eloquent{ |
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 | |
class Auth_Controller extends Base_Controller { | |
public $restful = true; | |
public function __construct() { | |
$this->filter( 'before', 'guest' )->except( array( 'logout', 'validate' ) ); | |
// Note: We may not always require CSRF on login for system based logins so ignore it here. | |
$this->filter( 'before', 'csrf' )->on( 'post' )->except( array( 'login' ) ); | |
} |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Compress output before sending it to the browser | |
|-------------------------------------------------------------------------- | |
| | |
| Removes all tabs and line breaks from the content before sending it to | |
| the browser. | |
| |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="author" content="Martin Bean" /> | |
<title>Twitter’s Bootstrap with Ryan Fait’s Sticky Footer</title> | |
<link rel="stylesheet" href="css/bootstrap.min.css" /> | |
<style> | |
html, body { | |
height: 100%; |