Skip to content

Instantly share code, notes, and snippets.

@lucian303
lucian303 / aliases.sh
Last active December 17, 2015 09:39
linux aliases
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Comment in the above and uncomment this below for a color prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u @ \h \[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(parse_git_branch)$ '
EDITOR='nano'
export EDITOR
@lucian303
lucian303 / silexDbFetch.php
Created May 15, 2013 23:14
silexDbFetch.php
<?php
/** @var $db Doctrine\DBAL\Connection */
$db = $app['db'];
$sql = "select * from users";
var_dump($db->fetchAll($sql, array())); die;
[
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+shift+down"], "command": "duplicate_line" }
]
@lucian303
lucian303 / sinatra.rb
Created May 11, 2013 22:51
sinatra.rb
require 'sinatra'
get '/' do
"Hello World!"
end
@lucian303
lucian303 / hello.py
Created December 22, 2012 05:19
flask hello world
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route('/lucian/<name>')
def lucian(name):
"""my controller"""
@lucian303
lucian303 / Preferences.sublime-settings
Last active October 13, 2015 06:27
sublime config
{
"auto_complete": true,
"auto_complete_delay": 0,
"bold_folder_labels": true,
"caret_style": "blink",
"close_windows_when_empty": true,
"color_scheme": "Packages/Lucian/Lucian.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "selection",
"font_face": "ayuthaya",
@lucian303
lucian303 / design.css
Created November 8, 2012 19:19
astria textual theme design.css
/* Basic Body Structure */
* {
margin: 0;
padding: 0;
font-size: 100%;
word-wrap: break-word;
}
body {
@lucian303
lucian303 / db_backup.sh
Created November 6, 2012 05:20
db backup
rm -f lucianux_db_backup.sql.gz
mysqldump -R -uroot -proot --all-databases > lucianux_db_backup.sql
gzip lucianux_db_backup.sql
@lucian303
lucian303 / .nanorc
Created November 6, 2012 05:05
mac .nanorc
## Initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure a value is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
@lucian303
lucian303 / .bashrc
Last active October 12, 2015 11:57
server .bashrc
# .bashrc
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# .bashrc