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
* How do I release this? | |
* I must be able to perform a 'rolling' release this in a live system w/o | |
causing a service interruption | |
* does it break backward compatability with existing users of the api/system/etc | |
* do we need to cut a new XSD? A new version (URI prefix) of our API? | |
* did we make updates to checkouts/SNAPSHOT deps? Do we need to cut new versions of project deps? | |
* how do I support existing users? | |
* in what order do the affected systems need to be released? | |
* are there system or service configuration changes that are required? | |
* What are the Security implications of my change? |
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
<appSettings> | |
<add key="log4net.Internal.Debug" value="true"/> | |
</appSettings> | |
<system.diagnostics> | |
<trace autoflush="true"> | |
<listeners> | |
<add | |
name="textWriterTraceListener" | |
type="System.Diagnostics.TextWriterTraceListener" | |
initializeData="C:\temp\log4net.txt" /> |
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_once 'lib/swift_required.php'; | |
// Create the Transport | |
$transport = Swift_SmtpTransport::newInstance('staging-smtp.postmarkapp.com', 2525) | |
->setUsername('api_key') | |
->setPassword('api_key') | |
; | |
/* |
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 | |
// Uses https://github.com/jjaffeux/postmark-inbound-php | |
require_once 'lib/Postmark/Autoloader.php'; | |
\Postmark\Autoloader::register(); | |
$inbound = new \Postmark\Inbound(file_get_contents('php://input')); | |
$filename = 'test.txt'; |
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
// ReSharper disable CheckNamespace | |
namespace RestSharp.Deserializers | |
// ReSharper restore CheckNamespace | |
{ | |
public class DynamicJsonDeserializer : IDeserializer | |
{ | |
public string RootElement { get; set; } | |
public string Namespace { get; set; } | |
public string DateFormat { get; set; } |
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
[WebInvoke(UriTemplate = "", Method = "POST")] | |
public Email Post(Email email) | |
{ | |
try | |
{ | |
repository.Add(email); | |
foreach (var file in email.Attachments) | |
{ |
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
Function GetTrackingURL(ServiceProvider as String, TrackingNumber as String) | |
If ServiceProvider = "UPS" Then | |
Return string.format("http://wwwapps.ups.com/WebTracking/processInputRequest?InquiryNumber1={0}&sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&track.x=0&track.y=0",TrackingNumber) | |
Else | |
Return string.format("http://www.fedex.com/Tracking?tracknumbers={0}&action=track&language=english&state=0&cntry_code=us",TrackingNumber) | |
End If | |
End Function |
NewerOlder