This file contains hidden or 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
Show hidden characters
/** | |
* Bootstrap for Twitter, class name completions | |
* Sublime Text 2 | |
*/ | |
{ | |
"scope": "string", | |
"completions": | |
[ | |
{"trigger":"google-maps\t[Bootstrap]","contents":"google-maps"}, |
This file contains hidden or 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 | |
App::uses('ModelBehavior', 'Model'); | |
class DateTimeRFCBehavior extends ModelBehavior { | |
public $settings = array(); | |
protected $_defaults = array( | |
'fields' => array('updated', 'modified', 'created'), | |
'format' => array( |
This file contains hidden or 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 AppShell extends Shell { | |
public function progressBar($current, $total, $size = 50) { | |
$perc = intval(($current / $total) * 100); | |
for ($i = strlen($perc); $i <= 4; $i++) { | |
$perc = ' ' . $perc; | |
} | |
$total_size = $size + $i + 3; |
This file contains hidden or 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
{"scope":"source.php - variable.other.php","completions":["php","SECOND","MINUTE","HOUR","DAY","WEEK","MONTH","YEAR","TIME_START","E_DEPRECATED","E_USER_DEPRECATED","CAKE_CORE_INCLUDE_PATH","CORE_PATH","WEBROOT_DIR","CAKE","APP","APPLIBS","CSS","JS","IMAGES","TESTS","TMP","LOGS","CACHE","VENDORS","IMAGES_URL","CSS_URL","JS_URL","FULL_BASE_URL","Cache","settings","ApcEngine","FileEngine","MemcacheEngine","WincacheEngine","XcacheEngine","IniReader","PhpReader","ConsoleErrorHandler","ConsoleInput","ConsoleInputArgument","ConsoleInputOption","ConsoleInputSubcommand","ConsoleOptionParser","ConsoleOutput","HelpFormatter","Shell","OptionParser","interactive","params","command","args","name","plugin","tasks","taskNames","uses","Tasks","stdout","stderr","stdin","ShellDispatcher","DS","CAKEPHP_SHELL","ROOT","APP_DIR","WWW_ROOT","TaskCollection","taskPathPrefix","AclShell","Acl","connection","ApiShell","paths","AppShell","BakeShell","CommandListShell","ConsoleShell","associations","badCommandChars","models","I18nShell", |
This file contains hidden or 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 | |
$css = file_get_contents('bootstrap.css'); | |
preg_match_all('/\.(([a-z]+\-)[a-z]+)/m', $css, $matches); | |
foreach ($matches[1] as $key => $value) { | |
$snippet = <<< EOF | |
<snippet> | |
<content><![CDATA[{$value}]]></content> | |
<tabTrigger>{$matches[2][$key]}</tabTrigger> | |
<scope>text.html</scope> | |
<description>{$value} Bootstrap</description> |
This file contains hidden or 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
My.AjaxForm = function(e) { | |
var $e = $(e) | |
, id = "#" + $e.attr("id") | |
, redirect = $e.data("ajax-redirect") | |
, target = $e.data("ajax-target") | |
$e.ajaxSubmit({ | |
beforeSubmit: function(arr, $form, options) { | |
$e.find(".btn[type=submit]").button('loading'); | |
$e.spin(); |
This file contains hidden or 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 | |
$file = file_get_contents(dirname(__DIR__) . '/test/mail.txt'); | |
$mail = mailparse_msg_create(); | |
mailparse_msg_parse($mail, $file); | |
$struct = mailparse_msg_get_structure($mail); | |
$parts = array(); | |
foreach($struct as $st) { | |
$section = mailparse_msg_get_part($mail, $st); | |
$info = mailparse_msg_get_part_data($section); |
This file contains hidden or 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 | |
App::uses('CakeEmail', 'Network/Email'); | |
class Base64Email extends CakeEmail { | |
protected function _renderTemplates($content) { | |
$rendered = parent::_renderTemplates($content); | |
array_walk($rendered, function(&$val, $key) { | |
$val = base64_encode($val); | |
}); |
This file contains hidden or 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 | |
App::uses('Cache', 'Cache'); | |
App::uses('Security', 'Utility'); | |
App::uses('Inflector', 'Utility'); | |
class CacheResultsBehavior extends ModelBehavior { | |
public function setup($model, $config = array()) { | |
$default = array( | |
'config' => 'default', |
This file contains hidden or 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 | |
App::uses('Component', 'Controller'); | |
App::uses('Inflector', 'Utility'); | |
class BaseActionComponent extends Component { | |
public $components = array('Session'); | |
public $Controller; |