Skip to content

Instantly share code, notes, and snippets.

View chrisuehlinger's full-sized avatar

Chris Uehlinger chrisuehlinger

View GitHub Profile
@chrisuehlinger
chrisuehlinger / the-algorithm.lua
Created January 19, 2024 21:47
Factorio self-expanding factory algorithm
-- Input Signal Key:
-- - red[some-item] - The number of that item in the logistic network,
-- negative if there is unsatisfied demand
-- - green[ore-type] - The amount of ore appearing on the resource scanner
-- Output Signal Key:
-- - out['red/signal-X'] - The X coordinate to survey
-- - out['red/signal-Y'] - The Y coordinate to survey
-- - out['red/signal-W'] - The width of the survey
-- - out['red/signal-H'] - The height of the survey
-- - out['construction-robot'] - The index of the blueprint to deploy
@chrisuehlinger
chrisuehlinger / index.js
Created November 18, 2022 06:31
Twitter Likes Exporter
import fs from 'fs';
import fetch from "node-fetch";
// Things you'll need to get from the Network tab of Chrome DevTools:
// The base URL (it contains an ID thing that might be unique to you)
let baseUrl = 'https://twitter.com/i/api/graphql/lr2pk7rKqCqLSqWRGRaW5Q/Likes'
// Your userId (in the URL, it comes early in the "variables" querystring)
let userId = "";
// Your token from the Authorization header (don't include the word "Bearer", don't share this with anyone or they can impersonate you)
let token = ''
@chrisuehlinger
chrisuehlinger / SocketListener.cs
Created July 1, 2021 01:00
Kumite Socket Listener
using System;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Net.WebSockets;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
using Newtonsoft.Json;
# Timer in the prompt inspired by https://jakemccrary.com/blog/2015/05/03/put-the-last-commands-run-time-in-your-bash-prompt/
function timer_start {
timer=${timer:-$SECONDS}
}
function timer_stop {
timer_total_seconds=$(($SECONDS - $timer))
timer_minutes=$(($timer_total_seconds / 60))
timer_seconds=$(($timer_total_seconds % 60))
@chrisuehlinger
chrisuehlinger / post-merge-raspi-electron
Last active December 31, 2019 20:00 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@chrisuehlinger
chrisuehlinger / .block
Last active June 2, 2016 05:52
Benchmark for D3 geoStreams with/without method reassignment
license: mit
@chrisuehlinger
chrisuehlinger / Draft.Md
Created January 5, 2016 20:15
expansion-draft

Expansion, Or: Time Isn't A Flat Circle, But Space Might Be

[Start with a screen with options for Text-only and Audio presentations]

Tutorial

Welcome to "The Shape of the Universe", an interactive lesson about shapes, the universe and some other things. Before we get started I feel it would be wise to go over the controls for this lesson. If you know them already, you can skip ahead.

@chrisuehlinger
chrisuehlinger / about.md
Last active June 1, 2016 18:59 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer