Skip to content

Instantly share code, notes, and snippets.

@jclement
jclement / 4seg.cpp
Created Dec 26, 2020
Silly random 4 segment display thing for Arduino
View 4seg.cpp
#include <Arduino.h>
#include <TM1637Display.h>
#define CLK 2
#define DIO 3
TM1637Display display(CLK, DIO);
void setup()
{
display.setBrightness(100);
}
@jclement
jclement / service.config
Last active Mar 22, 2018
Testing public facing AFE Nav service
View service.config
<!-- ================================================= -->
<!-- THIS FILE IS AUTOGENERATED. DO NOT MODIFY THIS FILE -->
<!-- ================================================= -->
<castle>
<?define DISABLE_TLS ?>
<properties>
<!-- Service Configuration -->
<servicePort>0</servicePort>
<serviceHost>localhost</serviceHost>
<webServicePort>9081</webServicePort>
View drop_all_objects_sqlserver.sql
/* ============================================================================================ */
/* Delete all stored procs, views, funcs and tables from a SQL Server database */
/* Adapted from: http://blog.kashyapmakadia.com/2009/08/drop-everything-in-sql-server-2005.html */
/* ============================================================================================ */
DECLARE @name VARCHAR(128)
DECLARE @constraint VARCHAR(254)
DECLARE @SQL VARCHAR(254)
/* Drop all non-system stored procs */
@jclement
jclement / tfs_history_dumper.cs
Created Aug 8, 2017
Quick script to dump TFS check-in history to CSV for further analysis
View tfs_history_dumper.cs
/* ========= NUGET PACKAGES ==============================================================
Id Versions ProjectName
-- -------- -----------
CsvHelper {2.16.3.0} TFSHistoryDumper
Microsoft.AspNet.WebApi.Client {5.2.2} TFSHistoryDumper
Microsoft.AspNet.WebApi.Core {
@jclement
jclement / guid.sql
Created Mar 28, 2016
Generate a GUID in form "1ce9b033-d9fa-452a-8767-970fb0548eb4" from Oracle
View guid.sql
select lower(regexp_replace(rawtohex(sys_guid()), '([A-F0-9]{8})([A-F0-9]{4})([A-F0-9]{4})([A-F0-9]{4})([A-F0-9]{12})', '\1-\2-\3-\4-\5')) from dual
@jclement
jclement / gist:076a95c94bb52e61c407
Created Feb 23, 2016 — forked from thomseddon/gist:4703968
Auto Expanding/Grow textarea directive for AngularJS
View gist:076a95c94bb52e61c407
/**
* The MIT License (MIT)
*
* Copyright (c) 2013 Thom Seddon
* Copyright (c) 2010 Google
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jclement
jclement / AESGCM.cs
Created Feb 21, 2016 — forked from jbtule/AESGCM.cs
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
View AESGCM.cs
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
View drip.cpp
#include "Arduino.h"
#include <Adafruit_NeoPixel.h>
#define PIN 4
#define LED_COUNT 60
// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...
Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
View bouncing_points.cpp
#include "Arduino.h"
#include <Adafruit_NeoPixel.h>
#define PIN 4
#define LED_COUNT 60
// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...
Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
@jclement
jclement / lights.cpp
Created Jan 26, 2016
Arduino sketch for annoying xmas lights (ws2812b)
View lights.cpp
#include "Arduino.h"
#include <Adafruit_NeoPixel.h>
#define PIN 4
#define LED_COUNT 60
// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...
Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);