Skip to content

Instantly share code, notes, and snippets.

@cawoodm
cawoodm / tmp.ts
Last active May 11, 2022 13:37
Example of TypeScript AS Compiler Error
View tmp.ts
interface MyObj1 {
[key: string]: string; // All other properties must be strings
name: string; // Mandatory properties
}
interface MyObj2 {
name: string; // Mandatory properties
age: number
}
let obj1: MyObj1 = {
name: 'foo',
@cawoodm
cawoodm / run.ps1
Created January 15, 2021 04:30
Run Any Code from PowerShell with Piston
View run.ps1
<#
.Synopsis
Run any code via the piston API
.Description
Pass in your code and it will be run on a remote machine via the piston API.
See https://github.com/engineer-man/piston for more details
.Parameter Language
The name of the language:
@cawoodm
cawoodm / Explanation of Rankings
Last active August 26, 2019 11:46
Explanation of Rankings
View Explanation of Rankings
The explanation of "UVV 000155 099" (scoring 15.364279) is:
{
"_shard": "[myindex][0]",
"_node": "6tgOP8JVSmai0c0uR_Co7g",
"_index": "myindex",
"_type": "_doc",
"_id": "UVV -00155-099",
"_score": 15.364279,
"_source": {
View Selenium IDE IF Example
store xpath count | //a[@title='Remove from shopping cart'] | count
if | ${count} > 0
echo | Found ${count} buttons!
click | //a[@title='Remove from shopping cart']
else |
echo | Found no buttons
end |
@cawoodm
cawoodm / NodeSP v0.01.js
Created October 21, 2012 18:12
NodeSP (Node Server Pages) is a proof of concept on using Node.js as a web server serving dynamic content generated from .js scripts akin to PHP or other CGI scripts.
View NodeSP v0.01.js
var http = require('http'),
url = require('url'),
vm = require('vm'),
fs = require('fs');
// Process request and send response to client
exports.run = function(request, response) {
var res = this.process(request);
response.statusCode = res.statusCode||200;
response.setHeader("Content-Type", res.contentType||"text/html");