Skip to content

Instantly share code, notes, and snippets.

View JordanAdams's full-sized avatar
🐼

Jordan Adams JordanAdams

🐼
  • Huddersfield, England
View GitHub Profile
---
title: Node
---
flowchart LR
    id
@JordanAdams
JordanAdams / 01.ts
Created December 1, 2022 11:47
Advent of Code 2022
const sum = (xs: number[]): number => xs.reduce((acc, x) => acc + x, 0);
const parseInput = (input: string): number[][] => {
return input
.split(/\n\n/)
.map((chunk) => chunk.split("\n").map((line) => parseInt(line, 10)));
};
export const part1 = (input: string): number => {
const totals = parseInput(input).map((inventory) => sum(inventory));
@JordanAdams
JordanAdams / userscript.js
Created September 28, 2021 12:59
UserScript - Humble Bundle All Keys
// ==UserScript==
// @name Humble Bundle All Keys
// @namespace https://github.com/jordanadams
// @version 0.1
// @description Snags all your keys on Humble
// @author Jordan Adams
// @match https://www.humblebundle.com/home/keys
// @grant none
// ==/UserScript==
#!/usr/bin/env bash
CREDENTIALS=$(
cf curl "/v2/service_instances?q=name:$1" | \
jq '.resources[0].entity.service_bindings_url' | \
xargs cf curl | \
jq '.resources[0].entity.credentials'
)
echo $CREDENTIALS | jq
LOW_BATTERY_THRESHOLD=20
NEWLINE='\n'
ICON_GITHUB="\ue725"
ICON_LOW_BATTERY="\uf579"
current_branch() {
echo $(git branch | grep '* ' | sed 's/* //')
}
prompt_dir() {
if [[ $(pwd) == $HOME ]]
@JordanAdams
JordanAdams / index.js
Created May 22, 2018 18:25
CodeUp - Karen (22nd May 2018)
// Mapping between letters and values
const numbers = {
A: 1,
B: 2,
C: 3,
D: 4,
E: 5,
F: 6,
G: 7
// ...
@JordanAdams
JordanAdams / readme.md
Created September 26, 2017 12:40
My personal workstation setup
@JordanAdams
JordanAdams / 2016-todo.md
Last active January 21, 2016 15:56
Things to do in 2016

Things to do in 2016

  • Learn a general purpose language such as C, Go, Rust, Elixir or Lisp
  • Learn Functional Programming (and apply it to a JS project)
  • Deploy a Node app (Likely to be JS Map)
  • Make at least one open source contribution per month (Ideally 3 per month toward the year end)
  • Get adept at flying first quadcopter and upgrade to a custom build.
  • Learn some Big Data (Hadoop etc.)
  • Build something in React+Redux