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_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 / 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]);
}
<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 / 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;
@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 / 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 / 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 / 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 / production.rb
Created September 3, 2012 13:24
adding all .css and .js to precompile assets
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( *.css *.js )
@vquaiato
vquaiato / fool_jquery.js
Created September 4, 2012 15:36
do not do this in jquery, please!
var foo = $(this).parent().parent().parent().parent().parent().find("#list-foos").html()