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 / teste_foo.cs
Created April 11, 2012 21:05
Refatorando testes
//um dev aí fez antes
var textoRecado = "Sbrubles, Timão regaça";
//le me refatorando
var textoRecado = "Sbrubles, QUEDE LIBERTADORES?";
@vquaiato
vquaiato / foo.html
Created March 27, 2012 03:42
ctrl + enter in textarea PARA NOOOOOSA ALEGRIA
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$('#foo-area').keypress(function (e) {
if (e.ctrlKey && e.keyCode == 13) {
alert("PARA NOOOOOSA ALEGRIA!");
}
});
@vquaiato
vquaiato / foo.html
Created March 26, 2012 18:18
hover images and p
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".icone-chat").mouseover(function(){
var data = $(this).attr("data");
var p = "#" + data;
$(p).toggleClass('com-destaque');
}).mouseout(function(){
@vquaiato
vquaiato / iphone_mediaquery.css
Created March 17, 2012 12:34
media queries to iPhone
<!--[if !IE]>-->
<link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)"
href="iPhone.css">
<!--<![endif]-->
@vquaiato
vquaiato / foo.cshtml
Created March 13, 2012 02:55
blergh using forms to sendo POST requests
<li id="[email protected]">
@using (Ajax.BeginForm("Gostei", "Foo", new AjaxOptions { UpdateTargetId = "[email protected]" }))
{
@Html.AntiForgeryToken()
@Html.Hidden("foo",foo.Id)
<input type="submit" name="gostei" value="gostei"/>
}
<span id="[email protected]">13</span>
</li>
@vquaiato
vquaiato / upload_mvc_.cs
Created March 1, 2012 12:40
Testando upload de imagens no asp.net MVC
[Test]
public void salva_imagem_quando_é_postada()
{
var controller = new SomeController();
var memoryStream = new MemoryStream();
//resource file
ArquivosPostados.ImagemPostada.Save(memoryStream, ImageFormat.Jpeg);
var postedFile = new Mock<HttpPostedFileBase>();
postedFile.Setup(p => p.InputStream).Returns(memoryStream);
@vquaiato
vquaiato / filtro_git_log.sh
Created February 18, 2012 00:59
filtro git log
git log --before="2 weeks ago" --after="2009-01-26" --pretty=oneline
@vquaiato
vquaiato / pagina.html
Created February 5, 2012 22:29
submetendo um form para o google spreadsheet sem redirect
<script type="text/javascript">
var submitted = false;
function submit(){
if(submitted) {
alert('Obrigado por cadastrar seu e-mail!');
document.getElementById('entry_0').value = '';
}
</script>
<iframe name="hidden_iframe" id="hidden_iframe" style="display: none;" onload="submit();"></iframe>
@vquaiato
vquaiato / .gitconfig
Created February 3, 2012 03:27
git pull && git push alias
[alias]
pp = !sh -c 'git pull && git push'
@vquaiato
vquaiato / bash_profile.sh
Created January 27, 2012 12:57
prompt do terminal
#copy the gist(https://gist.github.com/2550777) to the path below
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
GIT_PS1_SHOWDIRTYSTATE=true
#to show the full directory eg.: "~/Projects/foo_project"
PS1='\[\033[32m\]\u \033[01;34m\][\w]\[\033[31m\]\[\033[31m\]$(__git_ps1)\[\033[00m\] \$ '
#to show the current directory only eg.: "foo_project"