Skip to content

Instantly share code, notes, and snippets.

Avatar

William Oliveira gnuwilliam

View GitHub Profile
View Preferences.sublime-settings
{
"caret_extra_width": 2,
"color_scheme": "Packages/Colorsublime - Themes/IR_Black.tmTheme",
"draw_white_space": "all",
"enable_tab_scrolling": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
@gnuwilliam
gnuwilliam / .bashrc
Created May 4, 2016
bash config for OS X
View .bashrc
# OS X .bashrc
# requires brew install bash-completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\e[1;91m\]\W\[\033[38;5;93m\]$(__git_ps1) \[\e[97m\]\$\[\e[0m\] '
View Custom PS1
export PACKAGE_DIRS="$HOME/work/meteor-shared"
# PS1='\[\e[1;91m\]\u@\h \w \$\[\e[0m\] '
PS1='\[\e[1;91m\]\W \[\e[97m\]\$\[\e[0m\] '
View gist:afb20e5231193c4a8c0f
autocmd!
syntax on
:colorscheme inkpot
set number
set tabstop=2
set shiftwidth=2
set softtabstop=2
@gnuwilliam
gnuwilliam / git_branch_info
Created Oct 31, 2014
Get git branch info - shell
View git_branch_info
function parse_git_deleted {
[[ $(git status --ignore-submodules 2> /dev/null | grep deleted:) != "" ]] && echo "-"
}
function parse_git_added {
[[ $(git status --ignore-submodules 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+'
}
function parse_git_modified {
[[ $(git status --ignore-submodules 2> /dev/null | grep modified:) != "" ]] && echo "*"
}
View .bashrc
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export LANG=pt_BR.UTF-8
# shortcuts
alias gs="git status"
alias gd="git diff"
alias gc="git commit -a"
alias search="git grep"
@gnuwilliam
gnuwilliam / btn_helper.dart
Created Mar 16, 2014
Simple Dart helper class to add new button elements
View btn_helper.dart
class DartBtn {
ButtonElement addButton(id, text, btnClass, container) {
var button = new ButtonElement();
button..id = id
..text = text
..classes.add(btnClass);
querySelector(container).children.add(button);
return button;
}
}
View product.js
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
// models
var Category = require('./category')
, Colors = require('./color')
, Print = require('./print')
, BaseTissue = require('./base_tissue');
var productSchema = new Schema({
View category.js
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var categorySchema = new Schema({
name: String
});
module.exports = mongoose.model('Category', categorySchema);
View forms-validation-state.html
<div class="example">
<div class="form-group has-warning">
<label class="control-label" for="inputWarning">Input with warning</label>
<input type="text" class="form-control radius" id="inputWarning">
</div>
<div class="form-group has-error">
<label class="control-label" for="inputError">Input with error</label>
<input type="text" class="form-control radius" id="inputError">
</div>