Skip to content

Instantly share code, notes, and snippets.

View samjmck's full-sized avatar

Sam Mckenzie samjmck

View GitHub Profile
@samjmck
samjmck / stock-exchanges.ts
Created August 5, 2022 21:35
TypeScript enum of stock exchanges
export enum Exchange {
NYSE,
Nasdaq,
NasdaqHelsinki,
NasdaqStockholm,
NasdaqCopenhagen,
JapanExchangeGroup,
LuxembourgStockExchange,
LondonStockExchange,
ShanghaiStockExchange,
// identifier(s) should be in the following format:
// {
// resultName: 'name of key that will be used in the returned object',
// identifier: 'identifier that will be searched for in the format'
// }
function breakDown(string, format, identifiers){
for(let i = 0; i < identifiers.length; i++){
const identifier = identifiers[i];
identifier.index = format.indexOf(identifier.identifier);
}
@samjmck
samjmck / supreme-captcha-harvester.js
Last active March 12, 2022 12:59
Captcha harvesting for Supreme example
'use strict';
const {Harvester} = require('captcha-manager');
const request = require('request-promise-native');
const harvester = new Harvester();
const availableCaptchaResponseTokens = [];
const siteKey = '6LeWwRkUAAAAAOBsau7KpuC9AV-6J8mhw4AjC3Xz';
@samjmck
samjmck / adidas-size-code-calculator.js
Last active October 4, 2018 19:59
Calculate the an adidas size code by using real life sizes from different regions
function calculateSizeCode(size, type){
switch(type){
case 'USM':
return size * 20 + 530 - 80;
break;
case 'USF':
return size * 20 + 530 - 100;
break;
case 'UK':
return size * 20 + 530 - 70;
@samjmck
samjmck / proxy-install.sh
Last active October 26, 2021 02:03
Squid auto-install + configure to anonymous proxy
#!/bin/bash
squiddir='/etc/squid/'
lib='/usr/lib/squid/'
conf="${squiddir}squid.conf"
clients=()
authusers=()
passwd=()
sudo apt-get -y install apache2-utils
sudo apt-get -y install squid
sudo /etc/init.d/squid stop