Skip to content

Instantly share code, notes, and snippets.

@nobleach
nobleach / FizzBuzz
Created February 10, 2015 14:00
FizzBuzz
for (var i = 1; i <= 100; i++) {
var x = '';
if(i%3===0) x += 'Fizz';
if(i%5===0) x += 'Buzz';
console.log(x=='' ? i : x);
}
@nobleach
nobleach / fading text
Created December 18, 2014 14:04
Fading Text instead of ellipses
.post.grid .description {
margin-top: 15px;
font-weight: 400;
font-size: 14px;
line-height: 19px;
overflow: hidden;
position: relative;
max-height: 57px;
}
.post.grid .description:after {
@nobleach
nobleach / gist:c7e2e3a23fe88cb95dd4
Created June 12, 2014 02:57
ctrl-z fanciness for zsh
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
fg
zle redisplay
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
@nobleach
nobleach / gist:d196eabe801ad2789fb6
Created June 3, 2014 21:23
Quick nasty hosts file swiitch
HOSTS_FILE="/etc/hosts"
PRISTENE_HOSTS="$HOME/hosts-clean"
TEST_ENV_HOSTS="$HOME/hosts-test"
function switchhosts {
if [ $1 = "prod" ]
then
sudo cp "$PRISTENE_HOSTS" "$HOSTS_FILE"
fi
buildQuery: function() {
var query = [];
var name = this.username.value;
var startDate = this.startDate.value;
var endDate = this.endDate.value;
if(name) {
query.push("username LIKE '%"+name+"%'");
}