Skip to content

Instantly share code, notes, and snippets.

{
"type": "MessageCard",
"context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Insight Updates",
"sections": [
{
"activityTitle": "Insight Updates",
"activitySubtitle": "Updates from the Insight Data Warehouse",
"activityImage": "",
/*
* IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend
* An IR LED must be connected to ESP8266 pin 0.
* Version 0.1 June, 2015
* Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
*/
#include <IRremoteESP8266.h>
IRsend irsend(4); //an IR led is connected to GPIO pin 0
@nckltcha
nckltcha / SSRS Back Up Powershell
Created February 1, 2016 11:58
Back up SSRS report from Powershell
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Xml.XmlDocument");
[void][System.Reflection.Assembly]::LoadWithPartialName("System.IO");
$reportServerName = $reportServer;
$ReportServiceWebServiceURL = "http://$reportServerName/ReportServer/"
$ssrsVersion = $version;
$exportFolder = $folder;
if ($ssrsVersion -gt 2005)
{
"Id": "ActionTemplates-34",
"Name": "SSRS Report Backup",
"Description": "Automatically performs a back up of all SSRS reports on an SSRS Server.",
"ActionType": "Octopus.Script",
"Version": 1.0,
"Properties": {
"Octopus.Action.Script.ScriptBody": "\r\n[void][System.Reflection.Assembly]::LoadWithPartialName(\"System.Xml.XmlDocument\");\r\n[void][System.Reflection.Assembly]::LoadWithPartialName(\"System.IO\");\r\n \r\n$reportServerName = $reportServer;\r\n$ReportServiceWebServiceURL = \"http://$reportServerName/ReportServer/\"\r\n$ssrsVersion = $version;\r\n$exportFolder = $folder;\r\n\r\nif ($ssrsVersion -gt 2005) \r\n\t{\r\n\t\t# SSRS 2008/2012\r\n\t\t$reportServerUri = \"$ReportServiceWebServiceURL/ReportService2010.asmx\" -f $reportServerName\r\n\t} else {\r\n\t\t# SSRS 2005\r\n\t\t$reportServerUri = \"$ReportServiceWebServiceURL/ReportService2005.asmx\" -f $reportServerName\r\n\t}\r\n\r\n\r\n$Proxy = New-WebServiceProxy -Uri $reportServerUri -Namespace SSRS.ReportingService2005 -UseDefaultCredential ;\r
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
MDNSResponder mdns;
// Replace with your network credentials
<?php
function my_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
' . __( "To view this protected post, enter the password below:" ) . '
<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
</form>
';
return $o;
@nckltcha
nckltcha / 0_reuse_code.js
Created July 23, 2014 08:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nckltcha
nckltcha / gist:f8fb4402ce5b27eda044
Created July 22, 2014 21:15
gmdata closest stops
SELECT distinct stops.stop_id, stops.stop_name, route_long_name, arrival_time, ( 3959 * ACOS( COS( RADIANS( 53.48 ) ) * COS( RADIANS(stop_lat ) ) * COS( RADIANS( stop_lon ) - RADIANS( - 2.25 ) ) + SIN( RADIANS( 53.48 ) ) * SIN( RADIANS( stop_lat ) ) ) ) AS distance
FROM stops
LEFT JOIN stop_times ON stops.stop_id = stop_times.stop_id
LEFT JOIN trips ON stop_times.trip_id = trips.trip_id
LEFT JOIN routes ON routes.route_id = trips.route_id
WHERE routes.route_type =0
AND arrival_time
BETWEEN CURRENT_TIME( )
AND ADDTIME( CURRENT_TIME( ) , '00:10:00.0' )
@nckltcha
nckltcha / Powershell Script to Download Outlook Attachments
Last active May 14, 2020 12:37
Powershell Script to Download Outlook Attachments
$MailboxName = "MAILBOX"
$Subject = "EMAIL SUBJECT"
$ProcessedFolderPath = "/Inbox/Processed"
$downloadDirectory = "c:\temp"
Function FindTargetFolder($FolderPath){
$tfTargetidRoot = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,$MailboxName)
$tfTargetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$tfTargetidRoot)
$pfArray = $FolderPath.Split("/")
for ($lint = 1; $lint -lt $pfArray.Length; $lint++) {
@nckltcha
nckltcha / gist:3496353
Created August 28, 2012 08:58
Java Synth
// SimpleGroovyMidiSynthesizer sample
import javax.sound.midi.*;
public class MidiSynthesizerSample {
static void main(args) {
def notes = [60, 62, 64, 65, 67, 69, 71, 72, 72, 71, 69, 67, 65, 64, 62, 60]
def synth = MidiSystem.getSynthesizer()
def vel = 50 // velocity from 0..127