Skip to content

Instantly share code, notes, and snippets.

View jslatts's full-sized avatar

Justin Slattery jslatts

View GitHub Profile
@odinserj
odinserj / SkipWhenPreviousJobIsRunningAttribute.cs
Last active May 15, 2024 12:38
SkipWhenPreviousJobIsRunningAttribute.cs
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@nathancorvussolis
nathancorvussolis / wix-bootstrap-download-vcredist-sample.wxs
Last active April 22, 2024 15:29
Visual C++ 2015-2022 Redistributable - 14.36.32532
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle
Name="Example Product"
Version="1.2.3.4"
Manufacturer="John Doe"
Copyright="© 2023 John Doe"
@sscotth
sscotth / keystroke the clipboard extended.workflow
Last active April 17, 2024 12:21
Paste as keystrokes (macOS)
# Why?
# To paste text into windows that normally don't allow it or have access to the clipboard.
# Examples: Virtual machines that do not yet have tools installed, websites that hijack paste
#
# Extended vs Simple?
# * Includes an initial delay to allow you to change active windows
# * Adds small delay between keypresses for slower responding windows like SSH sessions
# * Better handling of numbers
# * VMWare bug fix
#
@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active March 12, 2024 00:27
Setting up Emporia Vue 2 with ESPHome
@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
@ArthurEzenwanne
ArthurEzenwanne / WordPDFConvert.cs
Last active July 7, 2023 06:21
C# code to convert .docx to .pdf using Microsoft.Office.Interop.Word
using System;
using Microsoft.Office.Interop.Word;
using Word = Microsoft.Office.Interop.Word;
namespace WordToPDFConsoleApp
{
class Program
{
static void Main(string[] args)
{
@coolaj86
coolaj86 / fs.extra.js
Last active May 22, 2022 22:45
fs.copy and fs.move for Node.JS
/*
UPDATE: this has finally been pushed to npm as `fs.extra`
URL: https://github.com/coolaj86/utile-fs/tree/master/fs.extra
*/
(function () {
"use strict";
console.warn('[Deprecated] See https://github.com/coolaj86/utile-fs');
var fs = require('fs')
@amacneil
amacneil / json.py
Last active March 18, 2021 03:24
Safely JSON-encode objects in your Django template
from django.core.serializers.json import DjangoJSONEncoder
from django.template import Library
from json import dumps as json_dumps
register = Library()
@register.filter
def json(data):
"""
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@kig
kig / gzip.js
Last active August 1, 2019 08:59
TarGZ = function(){};
// Load and parse archive, calls onload after loading all files.
TarGZ.load = function(url, onload, onstream, onerror) {
var o = new TarGZ();
o.onload = onload;
o.onerror = onerror;
o.onstream = onstream;
o.load(url);
return o;