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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 BaseModel extends Eloquent | |
{ | |
protected $rules = []; | |
protected $messages = []; | |
protected $errors; | |
public function validate(array $rules = []) | |
{ |
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 | |
## Migration ## | |
Schema::table('users', function(Blueprint $table) | |
{ | |
$table->updateColumn('username', 'string')->length(250)->nullable(); | |
}); | |
## \Illuminate\Support\Database\Schema\Blueprint.php ## | |
/** |
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
**Migration code** | |
<?php | |
Schema::table('users', function(Blueprint $table) | |
{ | |
$table->setNullable('username', true); | |
}); | |
**\Illuminate\Database\Schema\Blueprint** | |
<?php | |
public function setNullable($column_name, $setNullable=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
// Controller | |
public function layout() | |
{ | |
$tasks = array('hai'); | |
$data = array( | |
'tasks' => $tasks, | |
); | |
return View::make('site_templates.default') | |
->nest('page_template','tasks.all', $data); | |
} |
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
{ | |
"auto_complete_commit_on_tab": true, | |
"bold_folder_labels": false, | |
"color_scheme": "Packages/Color Scheme - Default/iPlastic.tmTheme", | |
"default_line_ending": "unix", | |
"detect_indentation": true, | |
"drag_text": false, | |
"font_size": 11.0, | |
"highlight_line": true, | |
"highlight_modified_tabs": false, |
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": ["ctrl+shift+c"], "command": "unexpand_tabs", "args": { "set_translate_tabs": false } }, | |
{ "keys": ["ctrl+shift+x"], "command": "expand_tabs", "args": { "set_translate_tabs": false } }, | |
{ "keys": ["ctrl+shift+alt+z"], "command": "run_macro_file", "args": {"file": "Packages/User/FixIndentation.sublime-macro"}}, | |
{ "keys": ["f2"], "command": "next_bookmark" }, | |
{ "keys": ["shift+f2"], "command": "prev_bookmark" }, | |
{ "keys": ["ctrl+shift+f2"], "command": "toggle_bookmark" }, |
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[ | |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class $1_module extends MX_Controller { | |
private \$called_from_url = FALSE; | |
public function __construct() | |
{ |
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[ | |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class $1_model extends ${2:CI}_Model { | |
public function get_by_id(\$$1_id) | |
{ | |
\$query = \$this->db | |
->from('$1') |
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[ | |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class $1_model extends ${2:CI}_Model { | |
public function get_by_id(\$$1_id) | |
{ | |
\$query = \$this->db | |
->from('$1') |
NewerOlder