Skip to content

Instantly share code, notes, and snippets.

View jslatts's full-sized avatar

Justin Slattery jslatts

View GitHub Profile
@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)
{
@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
#
@odinserj
odinserj / SkipWhenPreviousJobIsRunningAttribute.cs
Last active May 3, 2024 17:03
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"
@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):
"""
@dmnd
dmnd / requiresToImports.js
Last active March 4, 2017 20:50 — forked from ide/requiresToImports.js
Converts commonJS requires to es6 imports
// converts commonJS requires to es6 imports
// var foo = require('foo');
// ->
// import foo from 'foo';
//
// jscodeshift -t requiresToImports.js src/**/*.js*
'use strict';
module.exports = function(fileInfo, api) {
var j = api.jscodeshift;
@olragon
olragon / run.sh
Last active January 3, 2017 00:37
HHVM config for Drupal 7 with clean urls working fine.
#!/usr/bin/env bash
sudo hhvm --config site1.hhvm.hdf --user www-data --mode daemon -v "Log.Level=Verbose" -v "Log.NoSilencer=on" -v "Log.Header=on"
@calderas
calderas / node-twitterstream-proxy.js
Created August 25, 2011 20:25
Node JS Twitter Stream behind a proxy
var user="your_user"
var password="your_password"
var proxy_host="your_proxy.com"
var proxy_port=80
var http = require('http'), sys = require('sys')
var proxy = http.createClient(proxy_port, proxy_host);
var request = proxy.request('GET', '/1/statuses/sample.json', { host: 'stream.twitter.com', Authorization:new Buffer(user+":"+password).toString('base64')});