Skip to content

Instantly share code, notes, and snippets.


Joseph Lawson joekiller

View GitHub Profile
joekiller / .env.json
Last active Jul 30, 2022
TF2 Trade History
View .env.json
"key": "ABC123"
joekiller /
Created May 1, 2022
Updated craft hat skus
View BackpackSocketManager.ts
import ReconnectingWebSocket from 'reconnecting-websocket';
import WS from 'ws';
import * as Events from 'reconnecting-websocket/events';
export default class BackpackSocketManager {
private ws: ReconnectingWebSocket;
constructor() { = new ReconnectingWebSocket('wss://', [], {
WebSocket: WS,
joekiller / https.ts
Last active Apr 4, 2022
Nodejs Typescript Https get and post
View https.ts
import https from "https";
export async function httpsPost<T>(params: { hostname: string, path: string, headers: Record<string, any>, body?: string }): Promise<{ status: number, data: T | string }> {
let {path, hostname, body, headers} = params;
let options = {
port: 443,
method: 'POST',
joekiller / index.d.ts
Created Feb 21, 2022
node-pushbullet-api v3.0 typescript types
View index.d.ts
declare module 'pushbullet' {
import { EventEmitter } from 'events';
import { Response } from 'node-fetch';
interface MakeRequestOptions<T> {
qs?: Record<string, string>
json?: T
export interface MeResponse {
joekiller / get.ts
Created Dec 7, 2021
https.get typescript nodejs
View get.ts
const data: string = await new Promise((resolve, reject) => {
https.get(targetUrl, (res) => {
let rawData = '';
res.on('data', (chunk) => {
rawData += chunk;
res.on('end', () => {
try {
joekiller / device-farm-action.ts
Last active Nov 19, 2021
AWS CDK Device Farm Action for CodePipeline
View device-farm-action.ts
import codepipeline = require('@aws-cdk/aws-codepipeline');
import iam = require('@aws-cdk/aws-iam');
import cdk = require('@aws-cdk/core');
import { ActionCategory } from '@aws-cdk/aws-codepipeline';
import { Action } from '@aws-cdk/aws-codepipeline-actions';
* The OS and type of application you are testing.
export enum DeviceFarmAppType {
joekiller /
Created Oct 28, 2019
aws-cdk migrate RawStack to CDK
import yaml
from aws_cdk import core
class RawStack(core.Stack):
def __init__(self, scope: core.Construct, name: str, template_path: str, wrapped_parameters=None,
**kwargs) -> None:
"""import a stack off a path and munge in ssm variables if desired
:param template_path: path to raw stack being imported
:param wrapped_parameters: map of Parameter keys and default values
joekiller /
Created Aug 21, 2019
Nuke iam start-pipeline policies
for p in $(aws iam list-policies --query 'Policies[?starts_with(PolicyName, `start-pipeline`) == `true`].Arn' --output text); do
for v in $(aws iam list-policy-versions --policy-arn $p --query 'Versions[?IsDefaultVersion == `false`].VersionId' --output text); do
aws iam delete-policy-version --policy-arn $p --version-id $v
aws iam delete-policy --policy-arn $p
joekiller / query_timestamp.sql
Created Dec 20, 2017
Query alb_logs via time in AWS athena
View query_timestamp.sql
-- Setup an AWS Athena Application Load Balancer table via
-- Use the following to query between timestamps.
SELECT * FROM "sampledb"."alb_logs"
where date_parse(time, '%Y-%m-%dT%H:%i:%s.%fZ')
between TIMESTAMP'2017-12-20 03:00:00' and TIMESTAMP'2017-12-20 05:00:00'
limit 10;