This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#btn').click(function(){ | |
var cbNames[]; | |
$('#table td').find('input:checkbox:checked').each(function (i) { | |
cbNames[i] = ($(this).attr('name')); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSettings.traditional = true; // <-- Important | |
$('#btn').click(function () { | |
var array = []; | |
var url = '/Controller/Action'; | |
$.post(url, { array : array }); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("button[name=someName]").click(function () { | |
alert($(this).attr('name')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use enron | |
db.messages.aggregate([ | |
{'$project' : {'_id' : '$_id' , 'From' : '$headers.From', 'To' : '$headers.To'}}, | |
{'$unwind' : '$To'}, | |
{'$group' : {'_id' : {'_id' : '$_id', 'From' : '$From'}, 'To' : {'$addToSet' : '$To'}}}, | |
{'$unwind' : '$To'}, | |
{'$group' : {'_id' : {'From' : '$_id.From', 'To' : '$To'}, 'emails' : {'$sum' : 1}}}, | |
{'$sort' : {'emails' : -1}}, | |
{'$limit' : 5} | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOM : | |
<div id="tour" data-location="london"> | |
<button>Get Photos</button> | |
<ul class="photos"> | |
</ul> | |
</div> | |
JS: | |
$(document).ready(function() { | |
var el = $("#tour") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nunca esquecer de entrar como admin. | |
cd C:\Arquivos de programas\Microsoft Visual Studio 10.0\Common7\IDE> | |
tf undo /workspace:workspacename;workspaceowner $/projectname/filename.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
[AllowAnonymous] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl) | |
{ | |
if (User.Identity.IsAuthenticated) | |
{ | |
return RedirectToAction("Manage"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var express = require('express'); | |
var app = express(); | |
var server = require('http').Server(app); | |
var bodyParser = require('body-parser'); | |
var port = process.env.PORT || 3000; | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: true})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="author" content="lnmunhoz"> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1/Chart.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file is our stream | |
var fileStream = File.Create(@"..\"+ file.FileName, (int) file.Length); | |
var bytesInStream = new byte[file.Length]; | |
file.Read(bytesInStream, 0, bytesInStream.Length); | |
fileStream.Write(bytesInStream, 0, bytesInStream.Length); |
OlderNewer