Skip to content

Instantly share code, notes, and snippets.

View shawty's full-sized avatar

Peter "Shawty" Shaw shawty

View GitHub Profile
@iwanbk
iwanbk / lwip_udpecho_raw_server.c
Created November 28, 2011 09:17
LWIP UDP Echo Server with RAW API
/*
* author : Iwan Budi Kusnanto (ibk@labhijau.net)
*/
#include "lwip/api.h"
#include "lwip/sys.h"
#include "lwip/udp.h"
#include "udpecho_raw_server.h"
static void udpecho_raw_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
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;
@tmcw
tmcw / xyz_vs_tms.md
Last active April 3, 2024 06:18
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

@janmonschke
janmonschke / smarttv-debugging-server.js
Created February 20, 2013 02:24
A simple debugging server for the Samsung SmartTV platform. Simply start the server and then connect your machine to the TV and it'll print out (and save) everything the TV sends
var net = require('net');
var fs = require('fs');
// file name for the current log
var fileName = __dirname + '/log_' + new Date().getTime();
// Start a TCP Server
var server = net.createServer(function (socket) {
// Log what the TV sends
@whoeverest
whoeverest / acm-books.md
Last active January 2, 2023 10:37
Full download books from ACM.

Computers

  • Aspect-Oriented Programming with the e Verification Language
  • No Code Required
  • The Essential Persona Lifecycle

Artificial Intelligence

  • Ai for game developers
  • Computational Intelligence
@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
@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;
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@ChristianWeyer
ChristianWeyer / MimeTypeLookup.cs
Last active July 13, 2023 09:17
.NET MIME type lookup - 1200 well known MIME types in a C# helper class - thx to https://github.com/PawelGerr !
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
/*
MIT License
Copyright (c) 2014 Christian Weyer
@jpluimers
jpluimers / Disable-Fusion-Log-.NET-Assembly-Binding-Logging.bat
Created November 28, 2014 07:27
.NET enable and disable Fusion log
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f