Skip to content

Instantly share code, notes, and snippets.

View vquaiato's full-sized avatar
:octocat:
am I working?

Vinicius Quaiato vquaiato

:octocat:
am I working?
View GitHub Profile
@vquaiato
vquaiato / git-help.coffee
Created August 1, 2012 22:11
Hubot Git help script
# Show some help to git noobies
#
# use it as:
# git help <topic>
#
# <topic> can be one of:
# create|clone|add|remove|commit|synchronize|branch|merge|tag|restore
#
# developed by http://github.com/vquaiato - Crafters Software Studio
@vquaiato
vquaiato / github-activity.coffee
Created August 1, 2012 22:10
Github repo activity
# it was based on github-issues.coffee script
#
# add "date-utils":">=1.2.5" in the hubot-scripts.json file
#
# add HUBOT_GITHUB_USER to your heroku env
# the HUBOT_GITHUB_USER should map to your account, not the bot account
# the HUBOT_BOT_GITHUB_USER should map to the bot github username
# the HUBOT_BOT_GITHUB_PASS should map to the bot github password
# (you do not need to create a bot github account, but doing keeps your account secure)
#
@vquaiato
vquaiato / mimimi.coffee
Created August 1, 2012 22:06
Hubot mimimi script
module.exports = (robot) ->
robot.hear /^mimimi$/i, (msg) ->
msg.send "http://videobeta.net/gifs/15963.gif"
@vquaiato
vquaiato / InstallCommand.cs
Created July 17, 2012 14:48
Nuget Install Command Generate Token implementation
//http://nuget.codeplex.com/SourceControl/changeset/view/435b2c2e1ddd#src%2fCommandLine%2fCommands%2fInstallCommand.cs
private static string GenerateUniqueToken(IPackageManager packageManager, string packageId, SemanticVersion version) {
var packagePath = packageManager.FileSystem.GetFullPath(packageManager.PathResolver.GetPackageFileName(packageId, version));
var pathBytes = Encoding.UTF8.GetBytes(packagePath);
var hashProvider = new CryptoHashProvider("SHA256");
return Convert.ToBase64String(hashProvider.CalculateHash(pathBytes)).ToUpperInvariant();
}
@vquaiato
vquaiato / ribbon.css
Created June 19, 2012 19:48
simple css ribbon
/*
from: http://www.red-team-design.com/css-ribbons
*/
h1{
text-align: center;
position: relative;
color: #fff;
margin: 0 -30px 30px -30px;
padding: 10px 0;
<div class="control-group boolean optional">
<label class="boolean optional control-label" for="user_remember_me">Remember me</label>
<div class="controls">
<input name="user[remember_me]" type="hidden" value="0">
<label class="checkbox">
<input class="boolean optional" id="user_remember_me" name="user[remember_me]" type="checkbox" value="1">
</label>
</div>
</div>
@vquaiato
vquaiato / gist:2782117
Created May 24, 2012 15:07
Map/Reduce no MongoDB

###Collections Salas{_id} Reservas{_id, sala_id, data}

###Preciso contar as reservas de cada sala por uma data:

map = function () {
    emit(this.sala_id, [1]);
}
@vquaiato
vquaiato / git_completion.bash
Created April 29, 2012 14:28
git_completion
#!bash
#put in /usr/local/git/contrib/completion/git-completion.bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
@vquaiato
vquaiato / git.sh
Created April 27, 2012 13:48
usando git add -u
vquaiato [~/Desktop/foo] (master) $ rm foo
vquaiato [~/Desktop/foo] (master *) $ git add -u
vquaiato [~/Desktop/foo] (master +) $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: foo
#
vquaiato [~/Desktop/foo] (master +) $ git commit -m "removeno foo"
@vquaiato
vquaiato / raw_better-fifa-raquer.sh
Created April 12, 2012 03:53 — forked from marciol/raw_better-fifa-raquer.sh
raw_better-fifa-raquer
seq 1 1000000 | xargs -n1 -P100 -I{} curl -d "i_answer=1544512" http://pt.fifa.com/theclub/polls/pollId=1544769/staticvote.htmx
# Inspired by https://github.com/vquaiato/better-fifa-raquer