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
@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.

@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)
{
}
@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:

@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
{
@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):
@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]
@csgordon
csgordon / fsharp-debian.md
Last active February 28, 2017 09:18
Setting up F# on Debian

Installing F# on Debian

In theory you should be able to install the mono-devel package from Debian, then grab the latest checkout of F#'s Github repository and build. Unfortunately, the most recent versions of Debian's (and Ubuntu's) mono-devel package (3.0.6) include a lovely bug that breaks the F# build (https://bugzilla.xamarin.com/show_bug.cgi?id=10884). Another alternative is installing Debian Sid (unstable branch), where there are currently working F# packages, but installing a whole system from unstable has the sorts of stability issues you might expect, and cherry-picking the right .deb packages from the Debian repositories is unpleasant. There's also the option of using an F# developer's personal repository (https://gist.github.com/tkellogg/5619461), but I don't like adding untrusted sources to my sources.list.

After discovering that Vagrant includes support for a version of Debian Wheezy with F#, I figured out a working, relatively uninvasive approach based on the package

@mavnn
mavnn / part1.fs
Created October 14, 2013 09:55
Introducing F# Syntax
// Let's send an email!
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import random
from time import time
from py2neo import Graph, GraphError