Skip to content

Instantly share code, notes, and snippets.

View MarneeDear's full-sized avatar
📻
You can't stop the signal.

Marnee Dearman (KG7SIO) MarneeDear

📻
You can't stop the signal.
View GitHub Profile
@JeremyMorgan
JeremyMorgan / states.sql
Last active October 3, 2023 12:55
An SQL Query to insert 50 U.S. States into a database.Make sure your auto increment is set in MySQL, and Identity_insert is set in MS-SQL.
CREATE TABLE [state](
[stateID] [int] IDENTITY(1,1) NOT NULL,
[stateCode] [nchar](2) NOT NULL,
[stateName] [nvarchar](128) NOT NULL,
CONSTRAINT [PK_state] PRIMARY KEY CLUSTERED
( [stateID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY])
ON [PRIMARY]
@bracki
bracki / TimedJsonWebSignatureSerializer.py
Last active May 1, 2018 22:21
A TimedJsonWebSignatureSerializer that checks for http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#expDef. A bit like the TimedSerializer, but with self contained expiry time.
from itsdangerous import JSONWebSignatureSerializer, BadSignature, SignatureExpired
import calendar
import datetime
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
EXPIRES_IN_AN_HOUR = 3600
def __init__(self, secret_key, salt=None, serializer=None, signer=None, signer_kwargs=None, algorithm_name=None, expires_in=None):
@johnnyreilly
johnnyreilly / DemoAreaRegistration.cs
Last active October 29, 2019 13:43
What you need to unit test MVC controllers using MOQ.
using System.Web.Mvc;
namespace DemoApp.Areas.Demo
{
public class DemoAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
@learncfinaweek
learncfinaweek / gist:4121308
Created November 20, 2012 21:31
Document Handling - cfhttp

cfhttp makes HTTP calls from your ColdFusion server to an internet address of your choice. It is important to remember that it is the ColdFusion server that will be calling the URL, not the browser that is calling your ColdFusion page. Think of cfhttp as if you have proxy browser on your server that can send and receive information to any address on the internet. Imagine that this "virtual browser" on the server can save the information that it receives to a variable, so that it can be manipulated or passed to the user who has called your ColdFusion page.

Making a HTTP call

There are many attributes that the cfhttp tag can take. The simplest cfhttp call can be done like this:

@aliostad
aliostad / BinaryMediaTypeFormatter
Created April 28, 2012 15:17
An ASP.NET Web API media type formatter for application/octet-stream
public class BinaryMediaTypeFormatter : MediaTypeFormatter
{
private static Type _supportedType = typeof (byte[]);
private bool _isAsync = false;
public BinaryMediaTypeFormatter() : this(false)
{
}
@kevinfjbecker
kevinfjbecker / README.md
Last active April 28, 2020 16:53
Draggable Graph Nodes

This example use HTML5 Canvas to draw a simple graph.

The Node can be dragged to new positions on the canvas.