Skip to content

Instantly share code, notes, and snippets.

View tathamoddie's full-sized avatar

Tatham Oddie tathamoddie

View GitHub Profile
@tathamoddie
tathamoddie / Post Notification.yaml
Last active January 12, 2023 23:38 — forked from andrew-codechimp/Post Notification.yaml
Home Assistant Post Notification Example
alias: Post Notification
description: ""
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.z2maqarareed01_contact
from: "on"
to: "off"
for:
[alias]
st = status
ci = commit
br = branch
co = checkout
com = checkout master
fe = fetch origin
bn = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
rb = rebase
rbm = rebase master
@tathamoddie
tathamoddie / DeleteReferrals.cs
Created February 10, 2012 03:24 — forked from Romiko/DeleteReferrals.cs
Delete Duplicate Referrals based on latest date initiated
var referralsToDelete = duplicateReferrals
.GroupBy(r => r.Data.UniqueId)
.Where(g => g.Count() > 1)
.SelectMany(g => g.OrderBy(r => r.Data.DateInitiatedUtc).Skip(1));
foreach (var referralToDelete in referralsToDelete)
{
graphClient.Delete(referralNodeToDelete.Reference, DeleteMode.NodeAndRelationships);
}
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Security;
using Facebook;
using MyFacebookSite3434.Models;
namespace MyFacebookSite3434.Controllers
{
public class AccountController : Controller
@tathamoddie
tathamoddie / gist:621348
Created October 11, 2010 22:35 — forked from jstangroome/gist:621345
PowerShell script to test if ASP.NET padding security patch is applied
Set-StrictMode -Version Latest
[Reflection.Assembly]::Load('System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | Out-Null
$PatchedMethod = [System.Web.Configuration.MachineKeySection].GetMethods('NonPublic, Public, Static') |
Where-Object {
$LastParameter = $_.GetParameters() | Select-Object -Last 1
$_.Name -eq 'EncryptOrDecryptData' -and
$LastParameter -ne $null -and
$LastParameter.ParameterType -eq [bool] -and
//An Array of dataTables to to them from other controls
var dataTables = new Array ( );
function CreateDateTable ( controlID, headers, initialDataSource )
{
//Retrieve Table Properties to pass
//from the Parent Control to the rendered Table (DIV)
var renderedControl = document.getElementById ( controlID );
var tableCaption = renderedControl.getAttribute ( "_Caption" );
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#container
{
width: 900px;
overflow: hidden;
padding: 0;
background: #000;