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
#!/bin/bash | |
# Catch the system log events for when a camera turns on for conferencing. Should work on Zoom, Teams, etc. Your | |
# specific logging may vary. Also this sends API requests to the Elgato Key Light specifically. | |
# Begin looking at the system log via the steam sub-command. Using a --predicate and filtering by the correct | |
# subsystem first improves CPU performance DRASTICALLY. Then just pull out the camera event and shot a POST | |
# to the Elgato key light controller. It helps to create a static IP mapping in your DHCP setup so the IP of the light | |
# controller remains consistent. | |
log stream --predicate 'subsystem == "com.apple.cameracapture" && eventMessage CONTAINS[c] "posting notification"'| while read line; do |
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
sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $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
// Send an email with the Postmark .NET library | |
// Learn more -> http://developer.postmarkapp.com/developer-official-libs.html#dot-net | |
// Install with NuGet | |
PM> Install-Package Postmark | |
// Import | |
using PostmarkDotNet; | |
// Example asynchronous request |
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
<?php | |
require 'PHPMailer/PHPMailerAutoload.php'; | |
$mail = new PHPMailer; | |
//$mail->SMTPDebug = 3; // Enable verbose debug output | |
$mail->isSMTP(); // Set mailer to use SMTP | |
$mail->Host = 'smtp.postmarkapp.com'; // Specify main and backup SMTP servers | |
$mail->SMTPAuth = true; // Enable SMTP authentication |
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.Runtime.Remoting.Channels; | |
using System.Threading.Tasks; | |
using System.Xml; | |
using PostmarkDotNet; | |
namespace ConsolePostmarkLibTester | |
{ | |
class Program |
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.Threading.Tasks; | |
using PostmarkDotNet; | |
namespace ConsolePostmarkLibTester | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Task.Run(async () => |
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
foreach ($f in Get-ChildItem -Recurse -Path ".\" -Filter *.sln | sort-object) | |
{ | |
nuget.exe restore $f.FullName -verbosity detailed | |
} |
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
class Program | |
{ | |
private static readonly ILog _log = LogManager.GetLogger(typeof(Program)); | |
static void Main(string[] args) | |
{ | |
try | |
{ | |
var z = decimal.Divide(10, 0); | |
} | |
catch (Exception ex) |
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.Linq; | |
using System.Runtime.Serialization; | |
using System.Text; | |
using System.Threading.Tasks; | |
using log4net; | |
namespace ConsoleApplication1 | |
{ |
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
import httplib | |
import json | |
postmark_token = 'API_TOKEN' | |
toRecip = u'''\u2122'''.encode('utf8') | |
url = '/email' | |
msg = { | |
'From': '"JP Toto" <[email protected]>', |
NewerOlder