Skip to content

Instantly share code, notes, and snippets.

@WagnerMatos
WagnerMatos / spli_csv.sh
Created April 24, 2015 08:13
Split a cvs file in many parts
tail -n +2 file.txt | split -l 4 - split_
for file in split_*
do
head -n 1 file.txt > tmp_file
cat $file >> tmp_file
mv -f tmp_file $file
done
@WagnerMatos
WagnerMatos / Subl
Created April 1, 2015 14:20
Add Sublime text from command line
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
@WagnerMatos
WagnerMatos / list_users
Created March 31, 2015 11:46
List all users within the _www group in OS X
members () { dscl . -list /Users | while read user; do printf "$user "; dsmemberutil checkmembership -U "$user" -G "$*"; done | grep "is a member" | cut -d " " -f 1; }; members _www
@WagnerMatos
WagnerMatos / list_users_in_group
Created March 31, 2015 11:44
List all users within a group in OS X
members () { dscl . -list /Users | while read user; do printf "$user "; dsmemberutil checkmembership -U "$user" -G "$*"; done | grep "is a member" | cut -d " " -f 1; };
@WagnerMatos
WagnerMatos / BashAlias
Created March 22, 2015 09:23
How to make an alias from ll on bash
#Add the following in ~/.bash_profile
#MacOS:
alias ll='ls -lG'
#Linux:
alias ll='ls -l --color=auto'
@WagnerMatos
WagnerMatos / AddGruntProject
Created March 6, 2015 11:20
Install and add package to Gruntfile
npm install grunt-contrib-concat --save-dev
@WagnerMatos
WagnerMatos / GitResetBranch
Created March 6, 2015 09:27
Git reset branch
git reset --hard mybranch
# Frontend Guidelines
## HTML
### Semantics
HTML5 provides us with lots of semantic elements aimed to describe precisely the content. Make sure you benefit from its rich vocabulary.
```html
<!-- bad -->
@WagnerMatos
WagnerMatos / index.html.haml
Created February 22, 2015 14:55
Basic html starter in haml
!!! 5
-# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
-# <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
-# <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
-# <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
-# <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
%html.no-js{:lang => "en"}
.filter("timeago", function () {
//time: the time
//local: compared to what time? default: now
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
return function (time, local, raw) {
if (!time) return "never";
if (!local) {
(local = Date.now())
}