Skip to content

Instantly share code, notes, and snippets.

View chestozo's full-sized avatar

chestozo

  • Portugal
  • 01:48 (UTC +01:00)
View GitHub Profile
div.tag {
background: #EDF;
display: inline-block;
padding: .3em .6em;
padding-left: .8em;
border-radius: .6em;
font: 10pt arial;
text-shadow: 1px 1px #F7F7F7;
}
@chestozo
chestozo / gist:2731958
Created May 19, 2012 18:57
git: display ins and outs
function __get_git_branch {
local br=""
local git="$(git symbolic-ref HEAD 2> /dev/null)"
# git
if [ -n "$git" ]; then
br="${git##refs/heads/}"
fi
echo "$br"
@chestozo
chestozo / gist:2894548
Created June 8, 2012 08:48
Merge to master
function __get_git_branch {
local br=""
local git="$(git symbolic-ref HEAD 2> /dev/null)"
# git
if [ -n "$git" ]; then
br="${git##refs/heads/}"
fi
echo "$br"
@chestozo
chestozo / gist:2937233
Created June 15, 2012 15:58
Regexp with `g` flag #regexp #flags
"a=1&b=2".match(/[a-z]=\d/i) // --> ["a=1"]
"a=1&b=2".match(/[a-z]=\d/gi) // --> ["a=1", "b=2"]
"a=1&b=2".match(/[a-z]=(\d)/i) // --> ["a=1", "1"]
"a=1&b=2".match(/[a-z]=(\d)/gi) // --> ["a=1", "b=2"] - !!!
.img {
position: absolute;
background: #FBB;
width: 400px;
height: 80%;
}
.arrow-right {
position: absolute;
right: 0;
.left {
border: 1px solid;
border-color: #d7d7d7 #b8b8b8 #656667;
background: -webkit-linear-gradient(top,#fdfdfd 0,#BBB 100%);
left: 0;
width: 11px;
height: 12px;
position: absolute;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
body {
background: #CCC;
}
.tags {
position: relative;
top: 100px;
left: 100px;
width: 300px;
height: 200px;
body {
background: #CCC;
}
.tags {
position: relative;
top: 100px;
left: 100px;
width: 300px;
height: 200px;
.body {
position: absolute;
top: 100px;
left: 100px;
width: 200px;
height: 130px;
background: #444;
border-radius: 14px;
.search {
position: relative;
overflow: hidden;
height: 50px;
padding-right: 95px;
padding-left: 5px;
background: url("http://www.brandbuildsell.com/wp-content/uploads/2010/08/patterns_2-6-tumblr-background-images.jpg");
}