Skip to content

Instantly share code, notes, and snippets.

View jmprado's full-sized avatar

João Prado jmprado

  • Magix Tecnologia
  • Belo Horizonte, Brasil
View GitHub Profile
@jmprado
jmprado / SkipWhenPreviousJobIsRunningAttribute.cs
Last active October 16, 2023 15:17 — forked from odinserj/SkipWhenPreviousJobIsRunningAttribute.cs
SkipWhenPreviousJobIsRunningAttribute.cs
using System;
using System.Collections.Generic;
using Hangfire.Client;
using Hangfire.Common;
using Hangfire.States;
using Hangfire.Storage;
namespace ConsoleApp28
{
public class SkipWhenPreviousJobIsRunningAttribute : JobFilterAttribute, IClientFilter, IApplyStateFilter
@jmprado
jmprado / .gitignore
Created April 12, 2019 18:34
.gitignore for Visual Studio Code Cordova Projects on Window 10
# remove extension less files
*
!/**/
!*.*
# intermediate files
node_modules/**
build/
obj/
Debug/
@jmprado
jmprado / flatten.cs
Last active July 30, 2018 20:59
Flatten int array
using System;
using System.Collections.Generic;
namespace Algoritmo1
{
class Program
{
static void Main(string[] args)
{
int[,] testArray = new int[,] { { 1, 2 }, { 3, 4 } } ;
var markers;
var address;
var lat;
var lng;
var sleep = 1;
var count = 0;
function initMapCep(cep, num, elm) {
address = getAddr(cep, num);
GMaps.geocode({
(function (root, factory) {
if (typeof exports === 'object') {
module.exports = factory();
}
else if (typeof define === 'function' && define.amd) {
define('GMaps', [], factory);
}
root.GMaps = factory();
@jmprado
jmprado / gist:8d45e0b284524d0aa6ca
Last active August 29, 2015 14:15
RequireRolesAttribute.cs
//USAGE
// [RequireRoles(RoleToCheckFor = "Administrador,Editor")]
// public class NumeroPeriodicoController : Controller
// { ... }
//ATENTION
// DO NOT FORGET TO PASS THE USER PROFILE IN THE FORMS AUTHENTICATION PASS IN:
// FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Email, DateTime.Now,
// DateTime.Now.AddMinutes(2881), false, USER_PROFILE, FormsAuthentication.FormsCookiePath);
using (Graphics graphics = Graphics.FromImage(resized))
{
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.DrawImage(imagemOriginal, new Rectangle(0, 0, resized.Width, resized.Height), new Rectangle(0, 0, imagemOriginal.Width, imagemOriginal.Height), GraphicsUnit.Pixel);
if (addWaterMark == "1")
public ActionResult Index()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Index(LoginModel login)
{
if (ModelState.IsValid)
@jmprado
jmprado / DynamicLibrary.cs
Created February 24, 2014 19:46
DynamicLibrary.dll
//Copyright (C) Microsoft Corporation. All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
<script type="text/javascript">
$(function(){
$(".datepicker").datepicker();
$(".number").setMask("decimal");
});
</script>