Skip to content

Instantly share code, notes, and snippets.

@redgluten
redgluten / local-drush-uli.sh
Last active May 11, 2018 15:36
Drush uli command for local host
function duli() {
sitename=`dirname $PWD | grep -Po "^/var/www/\K(.*)$"`
uniquelink=`drush uli | grep -Po "^http://default/\K(.*)$"`
echo "http://$sitename.test/$uniquelink"
}
[
{
"args":
{
"to": "eol"
},
"command": "move_to"
},
{
"args":
[
// Insert comma to end of line
{ "keys": ["super+k", "super+enter"], "command": "run_macro_file", "args": {"file": "Packages/User/Macros/end-of-line.sublime-macro"} },
// Sublime Linter
{ "keys": ["ctrl+super+%"], "command": "sublimelinter_show_all_errors" },
// Alignment
{ "keys": ["ctrl+super+a"], "command": "alignment" },
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
/^0[1-9][0-9]{8}$/
// Check for correct phone or fax french format
Validator::extend('phone', function($attribute, $value, $parameters) {
return preg_match('/^0[1-9][0-9]{8}$/', strval($value));
});
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"create_window_at_startup": false,
"default_line_ending": "unix",
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"file_exclude_patterns":
@redgluten
redgluten / line_counter.sh
Created May 12, 2015 08:09
Count the number of lines of code from a specific file extension in a project
( find ./ -name '*.js' -print0 | xargs -0 cat ) | wc -l
@redgluten
redgluten / php_method.sublime-snippet
Last active August 29, 2015 14:18
Sublime Text snippet for creating a new PHP method
<snippet>
<content><![CDATA[
${1:public} function ${2:methodName}(${3:argument})
{
${4:// code}
}
]]></content>
<tabTrigger>meth</tabTrigger>
<scope>source.php</scope>
</snippet>