Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠

Jared Beach jmbeach

🏠
View GitHub Profile
View state-quality-fn.ts
import {
CountryResources,
ResourceDefinitions,
} from './models/country-resources.interface';
import { PEOPLE_PER_HOUSE } from './transformation-templates/transformation-templates';
export const stateQuality = (
country: CountryResources,
resourceDefinitions: ResourceDefinitions
) => {
View ResourceFileParser.ts
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());
View 2u.css
/* 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 Mar 9, 2021
Log body of requests in ServiceStack using attribute
View RequstDataSpyAttribute.cs
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 Mar 3, 2021
simple elastic and kibana docker-compose file
View docker-compose.yml
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:
View weblockproxy.mobileconfig
<?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 May 29, 2022
Configures iphone to use my desktop's Charles proxy server
View charlesproxy.mobileconfig
<?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>
View 2vu.css
/* 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 Jul 8, 2020
Custom Merge Logic for NetSuite
View Client_Customer.js
// 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 Apr 5, 2020
Simple Weather Rainmeter
View weather.ini
[Rainmeter]
Update=1000
[Metadata]
Author=DD.921
Version=1.2
License=Creative Commons: Attribution-Noncommercial-ShareAlike 4.0
Description=Displays the weather
Instructions=