Skip to content

Instantly share code, notes, and snippets.

View martinshaw's full-sized avatar
🚀

Martin Shaw martinshaw

🚀
View GitHub Profile
@martinshaw
martinshaw / before-shutdown.js
Created February 24, 2024 22:25 — forked from nfantone/before-shutdown.js
Node.js graceful shutdown handler
'use strict';
/**
* @callback BeforeShutdownListener
* @param {string} [signalOrEvent] The exit signal or event name received on the process.
*/
/**
* System signals the app will listen to initiate shutdown.
* @const {string[]}
\\\ Preparation Steps \\\
1. Plug in to Monitor?
2. Start VM
2.1 Start APIService
2.2 Start Manager
2.3 Run "Downloads\ngrok http 8001" on CMD
2.4 Prepare Chrome(?) for demo of manager. (CORS?). Leave signed in on dashboard
3. Setup Demo
3.1 Open GeoChat App
@martinshaw
martinshaw / inline.js
Created May 20, 2018 22:13
Moodle PDF Download JS Code
var list = [];
$(".activity.resource.modtype_resource ").find("a").each(
function(){
if($(this).attr("onclick").split("window.open(\'")[1] != undefined){
if ($(this).find("img").attr("src") == "https://moodle.mmu.ac.uk/theme/image.php/mmu/core/1526789056/f/pdf-24") {
list.push($(this).attr("onclick").split("window.open(\'")[1].split("\', ''")[0]);
}
}
}
);
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
%% Define your header here.
%% See http://texblog.org/2007/11/07/headerfooter-in-latex-with-fancyhdr/
\fancyhead[CO,CE]{John Doe, Class 123}
\usepackage[usenames,dvipsnames]{color} %% Allow color names
%% The listings package will format your source code
import Network;
import JSON;
+ GeolocationProvider inherits \Objects\MappableAdopter<Float, Float>{
public f constructor <> {
\Network\Fetch({
Method: 'GET',
URL: \Network\Path <String "http://iplocation.net/api/" +toString<\Network\ClientIPAddress> >,
isSuccessful: <\Network\FetchResponse response> {
yield new \JSON\JsonObject {
@martinshaw
martinshaw / Message.rna
Created December 16, 2017 10:37
Need to implement ID
+ Message inherits \MySQL\DAO\Model {
String tables = "messages";
String msgContents = null;
String msgOrigin = null;
String msgRecipient = null;
Boolean isFirstSave = true;
public f constructor <
String _msgContents,
@martinshaw
martinshaw / test.php
Created November 4, 2017 21:00
Get requests sent to the raw version of this file while testing CRWA1
{
"status": "ok"
}
f Main <String[] args> {
yield new \GeoChat\GeoServices\Coord <
\FloatUtils\Float _latitude,
\FloatUtils\Float _longitude
>;
f isContainedInPolygon <\GeoChat\GeoServices\Polygon _polygon>{
// Check Contraints
\var rectangularCheck = Reduce <_polygon.points.asArray, Int> (_point, i) => {
\var latCheck = (_point.latitude < @_latitude);
\var longCheck = (_point.longitude < @_longitude)
@martinshaw
martinshaw / notes.md
Last active November 3, 2017 10:46
!!! Notes for Crypto-Ransomeware Assignment !!!

1 Substitution Algo 1 Transposition Algo

Combine for CRWA

C = Cyphertext M = Plaintext message K = Key E = Encrypt Function

https://github.com/r0adkll/Slidr
https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh
https://github.com/umano/AndroidSlidingUpPanel
https://github.com/DanielMartinus/konfetti
https://github.com/vsvankhede/easyfonts
https://github.com/JoanZapata/android-pdfview
https://github.com/flavioarfaria/KenBurnsView
https://github.com/felipecsl/GifImageView
https://github.com/hdodenhof/CircleImageView
https://github.com/tasomaniac/EmailAutoCompleteTextView