This file contains hidden or 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
// Some regex's to format the content in the tweet | |
tweet.text = tweet.text.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi, '<a href="$1" target="_blank">$1<\/a>'); | |
tweet.text = tweet.text.replace(/@([a-zA-Z0-9_]+)/gi, '<a href="http://twitter.com/$1" target="_blank" class="username">@$1<\/a>'); | |
tweet.text = tweet.text.replace(/#([a-zA-Z0-9_]+)/gi, '<a href="http://search.twitter.com/search?q=%23$1" target="_blank" class="hashtag">#$1<\/a>'); |
This file contains hidden or 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
context.Response.Cache.SetExpires(DateTime.Now.AddDays(14)); | |
context.Response.Cache.SetLastModified(dataAlteracao); | |
context.Response.Cache.SetMaxAge(new TimeSpan(336, 0, 0)); |
This file contains hidden or 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
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll" | |
$instancias = New-Object System.Collections.Generic.List[System.Collections.Hashtable] | |
$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = ""; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) |
This file contains hidden or 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
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll" | |
$instancias = New-Object System.Collections.Generic.List[System.Collections.Hashtable] | |
$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = ""; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
##$instancias.Add(@{"maquina" = "i-xxxxx"; "ip" = "111.111.1.11"; endpoint= "https://ec2.sa-east-1.amazonaws.com/"}) | |
$secretKeyID="Secret key" |
This file contains hidden or 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
(function ($) { | |
$.fn.enableCheckboxRangeSelection = function () { | |
var lastCheckbox = null; | |
var $spec = this; | |
$spec.unbind("click.checkboxrange"); | |
$spec.bind("click.checkboxrange", function (e) { | |
if (lastCheckbox != null && (e.shiftKey || e.metaKey)) { | |
$spec.slice( | |
Math.min($spec.index(lastCheckbox), $spec.index(e.target)), | |
Math.max($spec.index(lastCheckbox), $spec.index(e.target)) + 1 |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
using Facebook; | |
namespace MvcApplication1.Controllers |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
ConsoleSpinner spin = new ConsoleSpinner(); | |
Console.Write("Working...."); | |
while (true) | |
{ | |
spin.Turn(); | |
} | |
} |
This file contains hidden or 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
$('#Telefone') | |
.mask("(99) 9999-9999?9") | |
.live('focusout', function (event) { | |
var target, phone, element; | |
target = (event.currentTarget) ? event.currentTarget : event.srcElement; | |
phone = target.value.replace(/\D/g, ''); | |
element = $(target); | |
element.unmask(); | |
if (phone.length > 10) { | |
element.mask("(99) 99999-999?9"); |
This file contains hidden or 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
public static class DateExtensions | |
{ | |
public static int BusinessDay(this DateTime data) | |
{ | |
var inicioMes = new DateTime(data.Year, data.Month, 1); | |
int total = 0; | |
while (inicioMes.Date <= data.Date) | |
{ |