Skip to content

Instantly share code, notes, and snippets.

View tuespetre's full-sized avatar
😶

Derek Gray tuespetre

😶
View GitHub Profile
@tuespetre
tuespetre / example.sql
Last active January 29, 2023 15:20
An attempt at mimicking Postgresql's LISTEN/NOTIFY functionality in SQL Server, using Service Broker
// Worker process:
EXEC [notifications].[Listen] N'something-happened', 5000
// Some other process:
EXEC [notifications].[Notify] N'something-happened'
@postspectacular
postspectacular / blinky.S
Created December 12, 2015 23:44
ARM blink example (ASM only)
.syntax unified
.cpu cortex-m4
.thumb
// configuration values for STM32F4x
// see: http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf
#define AHB1PERIPH_BASE 0x40020000
#define RCC_BASE AHB1PERIPH_BASE + 0x3800
#define RCC_AHB1_ENR RCC_BASE + 0x30
@tuespetre
tuespetre / FilterHelper.cs
Last active June 29, 2017 08:06
A utility class and general pattern for creating Github Issues-style Elasticsearch query string builder UIs.
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Your.Web.Project
{
public static class FilterHelper
{
public static bool HasOption(string query, string option)
{
var regex = GetRegex(option);
@sheastrickland
sheastrickland / UrlRewriteResources.ps1
Created March 19, 2015 23:28
Powershell DSC for UrlRewrite Module install and ApplicationHost changes
Package UrlRewrite
{
#Install URL Rewrite module for IIS
DependsOn = "[WindowsFeaturesWebServer]windowsFeatures"
Ensure = "Present"
Name = "IIS URL Rewrite Module 2"
Path = "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
Arguments = "/quiet"
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 2, 2024 20:18
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

exception ItemAlreadyExists of string
exception ItemNotFound of string
exception DomainError of string
type Command =
| CreateInventoryItem of Id: int
| RenameInventoryItem of Id: int * Name: string
| RemoveItemsFromInventory of Id: int * Amount: int
| AddItemsToInventory of Id: int * Amount: int
| DeactivateInventoryItem of Id: int
@pmhsfelix
pmhsfelix / gist:5667375
Created May 29, 2013 01:29
A ASP.NET Web API based local proxy that forwards via Runscope, using @darrelmiller RunscopeMessageHandler. Just configure your HTTP client (e.g. a browser) to use a proxy at 127.0.01:8080
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.ServiceModel;
@DamianEdwards
DamianEdwards / Program.cs
Created March 19, 2013 05:54
Demonstrates that SqlDependency notifications can occur concurrently with the command that set them up. This might cause issues in certain cases if the application isn't expecting multiple commands to be executed at the same time.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Threading;
namespace SqlDependencyConcurrency
{
class Program
{
private static readonly string _connectionString = "Data Source=(local);Initial Catalog=Sample;Integrated Security=SSPI;";