Skip to content

Instantly share code, notes, and snippets.

View redgluten's full-sized avatar
:octocat:
-> DROP ICE!

Gluten redgluten

:octocat:
-> DROP ICE!
View GitHub Profile
@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
*/
@redgluten
redgluten / Connection.php
Created August 16, 2016 08:10
Basic PDO based connection class for PHP
<?php
class Connection
{
public function make($dsl, $username, $password)
{
try {
return new PDO($dsl, $username, $password);
} catch (PDOException $e) {
die($e->getMessage());
function dd($data) {
echo '<pre>';
die(var_dump($data));
echo'</pre>';
}
@redgluten
redgluten / global-homestead.sh
Created December 22, 2015 09:46 — forked from taylorotwell/global-homestead.sh
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...
" Syntax highlighting
" Enable syntax highighting
syntax enable
" 256 colours, please
set t_Co=256
" Enable line numbers on startup
set number