Skip to content

Instantly share code, notes, and snippets.

View shawty's full-sized avatar

Peter "Shawty" Shaw shawty

View GitHub Profile
@ca0v
ca0v / proj4.d.ts
Last active August 22, 2016 15:43
proj4.d.ts
declare module "proj4" {
interface Transformer {
forward: (p: Point) => Point;
inverse: (p: Point) => Point;
}
class Point {
x: number;
y: number;
02; // Get firmware version
4A 01 00; // 1 target requested
// Select the payment system environment
40 01 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31;
40 01 00 C0 00 00 20;
40 01 00 B2 00 0C 00;
40 01 00 B2 01 0C 00;
40 01 00 B2 01 0C 29;
@hyle
hyle / ko.utils.3.4.0.signatures.js
Last active September 25, 2018 09:12
KnockoutJS 3.4.0 / 3.4.1 / 3.4.2 utils (ko.utils) signatures
// knockout 3.4.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@AnthonySteele
AnthonySteele / NancyModuleExtensions
Last active April 11, 2019 09:19
Example code for my blog post on function shims for NancyFx request handlers
/*
* Example code for my blog post on function shims for NancyFx request handlers
* Blog post is here: http://anthonysteele.co.uk/more-patterns-for-web-services-in-nancyfx
*/
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Nancy;
@Zonciu
Zonciu / netcore3-wpf-designer
Created March 3, 2019 06:44
WPF designer project configuration in net core 3
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System" />
<Reference Include="System.Data" />
@macromaniac
macromaniac / XHR.ts
Last active November 3, 2019 23:19
simple typescript xhr using promises
module XHR {
export class Header {
header: string;
data: string;
constructor(header: string, data: string) {
this.header = header;
this.data = data;
}
}
@Zonciu
Zonciu / netcore3-winform-designer
Last active November 14, 2019 08:45
WinForm designer in net core 3, no need to create another .net framework project and link files
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System" />
@isaacabraham
isaacabraham / SimpleTimetableParser.fs
Last active January 28, 2020 23:29
Parses ATOC timetable data in CIF format for UK national rail timetables (available at http://data.atoc.org/how-to). The parser has two main entry methods - loadStations, which parses the .MSN file into stations, and loadTimetables, which parses the .MCA portion of the ATOC dataset into timetables (and also uses the output of loadStations to cre…
open System
// Basic data structures
[<Flags>]
type Day =
| None = 0
| Mon = 1
| Tue = 2
| Wed = 4
| Thu = 8
@SQL-MisterMagoo
SQL-MisterMagoo / index.html
Last active March 19, 2020 19:30
Monitor Blazor WASM loading and report errors
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Blazor Loading</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>
@Longfld
Longfld / Serilog
Last active April 24, 2020 19:07
How to use serilog in ASP.NET Core 2.0
How to use serilog in ASP.NET Core 2.0
One of major changes core 2.0 compare to core 2 preview is how to registe logging.
logging should be configged before website instanced.
public class Program
{
public static void Main(string[] args)
{