This file contains 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 | |
# 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 | |
log stream --predicate 'subsystem == "com.apple.VDCAssistant" && eventMessage CONTAINS[c] "Post event kCameraStream"'| while read line; do | |
# If we catch a camera start event, turn the light on | |
if echo "$line" | grep -q "Post event kCameraStreamStart"; then | |
echo "Camera has been activated, turn on the light." | |
curl -s -o /dev/null http://192.168.1.198/gpio/1 |
This file contains 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 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 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 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 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 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 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 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 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" <jp@wildbit.com>', |
NewerOlder