Skip to content

Instantly share code, notes, and snippets.

View jmbeach's full-sized avatar
🏠

Jared Beach jmbeach

🏠
View GitHub Profile
import {
CountryResources,
ResourceDefinitions,
} from './models/country-resources.interface';
import { PEOPLE_PER_HOUSE } from './transformation-templates/transformation-templates';
export const stateQuality = (
country: CountryResources,
resourceDefinitions: ResourceDefinitions
) => {
import { readFileSync } from 'fs';
export interface WorldResource {
name: string;
weight: number;
notes: string;
}
export const parseResourceFile = (fileName: string): { [key: string]: WorldResource } => {
const result: { [key: string]: WorldResource } = {};
const fileText = readFileSync(fileName, { encoding: 'utf-8' });
const lines = fileText.split('\n').map(x => x.trim());
@jmbeach
jmbeach / 2u.css
Last active March 20, 2021 19:30
/* override video player width */
.diIHwN {
width: 90%;
max-width: none;
}
.video-js .vjs-control.vjs-button.vjs-control-skip-forward::before {
content: "⏩️ 15s";
font-size: 1em;
margin-top: 0.7em;
@jmbeach
jmbeach / RequstDataSpyAttribute.cs
Last active March 9, 2021 18:43
Log body of requests in ServiceStack using attribute
public class RequestDataSpyAttribute : RequestFilterAttribute
{
// gets injected by ServiceStack
public ILog Log { get; set; }
private readonly string _logMessage;
public RequestDataSpyAttribute(string logMessage)
{
_logMessage = logMessage;
@jmbeach
jmbeach / docker-compose.yml
Created March 3, 2021 03:05
simple elastic and kibana docker-compose file
version: '2.2'
services:
es01:
image: elasticsearch:7.10.1
container_name: es01
environment:
- discovery.type=single-node
volumes:
- data01:/usr/share/elasticsearch/data
ports:
@jmbeach
jmbeach / weblockproxy.mobileconfig
Created February 28, 2021 02:36
Weblock Proxy Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Configures proxy settings to use Charles Proxy</string>
<key>PayloadDisplayName</key>
@jmbeach
jmbeach / charlesproxy.mobileconfig
Last active October 9, 2022 14:14
Configures iphone to use my desktop's Charles proxy server
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Configures proxy settings to use Charles Proxy</string>
<key>PayloadDisplayName</key>
/* override video player width */
.diIHwN {
width: 90%;
max-width: none;
}
.video-js .vjs-control.vjs-button.vjs-control-skip-forward::before {
content: "⏩️ 15s";
font-size: 1em;
margin-top: 0.7em;
@jmbeach
jmbeach / Client_Customer.js
Created July 8, 2020 18:45
Custom Merge Logic for NetSuite
// Client script Merge clicked fragment
MergeClicked = function () {
var id = document.getElementById('id').value;
window.location.href = '/app/site/hosting/scriptlet.nl?script=customscript_customer_merge_page&deploy=1&customerid=' + id;
};
@jmbeach
jmbeach / weather.ini
Created April 5, 2020 20:54
Simple Weather Rainmeter
[Rainmeter]
Update=1000
[Metadata]
Author=DD.921
Version=1.2
License=Creative Commons: Attribution-Noncommercial-ShareAlike 4.0
Description=Displays the weather
Instructions=