Skip to content

Instantly share code, notes, and snippets.

View robinst's full-sized avatar

Robin Stocker robinst

View GitHub Profile
@robinst
robinst / twitter-archive-following-followers.md
Last active November 12, 2024 09:51
Twitter: How to archive your following/followers data (usernames, etc)

Twitter allows users to download parts of their data, see How to download your Twitter archive.

But what's not included in that data dump is the usernames/handles of the people that you follow or are following you. All you get is account IDs which is just an internal number and so a bit useless when it comes to archival.

Here's a way to get that data (you need to know how to run stuff in the terminal):

  1. Go to your Twitter profile in a desktop browser (Firefox or Chrome)
  2. Right click on page → Inspect → Network tab
  3. Click on the Following link (e.g. https://twitter.com/{yourusername}/following)
@robinst
robinst / day04.rs
Last active December 4, 2019 11:25
Advent of Code 2019 day 4
//! https://adventofcode.com/2019/day/4
use std::cmp::Ordering;
fn main() {
let count = (359282..820401)
.filter(|d| check_part1(*d))
.count();
println!("Part 1: {}", count);
@robinst
robinst / run1.txt
Created July 3, 2018 03:35
syntect: Benchmarks for PR 186
stack_matching time: [29.465 ns 30.088 ns 30.789 ns]
change: [+3.0144% +9.9407% +18.609%] (p = 0.02 < 0.05)
Performance has regressed.
Found 1 outliers among 10 measurements (10.00%)
1 (10.00%) high severe
highlight/"highlight_test.erb"
time: [2.6709 ms 2.9808 ms 3.3609 ms]
change: [+64.142% +86.028% +111.33%] (p = 0.00 < 0.05)
Performance has regressed.
@robinst
robinst / Cargo.toml
Created April 24, 2018 13:09
criterion-with-string-inputs
[package]
name = "criterion-test"
version = "0.1.0"
authors = ["Robin Stocker"]
[dev-dependencies]
criterion = "*"
[[bench]]
name = "example"
@robinst
robinst / change.diff
Created April 24, 2018 07:05
syntest with push/pop fix
--- syntest-base.txt 2018-04-20 15:31:56.000000000 +1000
+++ syntest-after.txt 2018-04-24 16:47:12.000000000 +1000
@@ -138,449 +138,19 @@
Ok(Success(36))
Testing file ./testdata/Packages/C#/tests/syntax_test_Operators.cs
The test file references syntax definition file: Packages/C#/C#.sublime-syntax
- Assertion selector "storage.type" from line 4 failed against line 3, column range 0-1 (with text "i") has scope [<source.cs>]
- Assertion selector "storage.type.nullable" from line 5 failed against line 3, column range 3-4 (with text "?") has scope [<source.cs>]
- Assertion selector "variable.other" from line 6 failed against line 3, column range 8-9 (with text "g") has scope [<source.cs>]
- Assertion selector "punctuation.accessor.null-coalescing" from line 7 failed against line 3, column range 23-25 (with text "?.") has scope [<source.cs>]
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:335:20
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::_print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic
6: std::panicking::begin_panic_fmt
7: rust_begin_unwind
@robinst
robinst / syntest-onig-to-fancy.diff
Last active January 22, 2018 01:05
syntect: change from onig to fancy-regex
--- syntest-master-53a251d.txt 2018-01-22 11:57:07.000000000 +1100
+++ ../syntect/syntest-fancy-cd3423a.txt 2018-01-22 11:43:32.000000000 +1100
@@ -42,6 +42,16 @@
Ok(Success(424))
Testing file ./testdata/Packages/ASP/syntax_test_asp.asp
The test file references syntax definition file: Packages/ASP/HTML-ASP.sublime-syntax
+ Assertion selector "storage.modifier.asp" from line 73 failed against line 63, column range 41-42 (with text "c") has scope [<text.html.asp>, <source.asp.embedded.html>, <meta.class.asp>, <meta.class.body.asp>, <invalid.illegal.unexpected-token.asp>]
+ Assertion selector "storage.modifier.asp" from line 73 failed against line 63, column range 42-43 (with text "o") has scope [<text.html.asp>, <source.asp.embedded.html>, <meta.class.asp>, <meta.class.body.asp>, <invalid.illegal.unexpected-token.asp>]
+ Assertion selector "storage.modifier.asp" from line 73 failed against line 63, column range 43-44 (with text "n") has scope [<text.html.asp>, <source.asp.embedded.html>, <meta.class.asp>,
@robinst
robinst / gh-releases-to-changelog.sh
Created September 8, 2017 05:49
Commands to help convert GitHub releases to CHANGELOG.md
# Get releases for your repository (change the URL and add user/password if necessary)
# If there's more than one page, you might have to do more requests with `?page=2` etc
curl https://api.github.com/repos/:owner/:repo/releases > releases.json
# Use jq! https://stedolan.github.io/jq/
# "v" is a prefix to strip from the release names, might not be necessary
jq -r '.[] | "## [" + (.name | ltrimstr("v")) + "] - " + .created_at[:10] + "\n" + .body' releases.json >> CHANGELOG.md
# Now edit the CHANGELOG.md, see here: http://keepachangelog.com/en/1.0.0/
module.exports={"33088":19991,"33089":20002,"33090":20012,"33091":20053,"33092":20066,"33093":20106,"33094":20144,"33095":20203,"33096":20205,"33097":20220,"33098":20252,"33099":20362,"33100":20479,"33101":20546,"33102":20560,"33103":20600,"33104":20696,"33105":20702,"33106":20724,"33107":20758,"33108":20810,"33109":20817,"33110":20836,"33111":20842,"33112":20869,"33113":20880,"33114":20893,"33115":20902,"33116":20904,"33117":20905,"33118":20935,"33119":20950,"33120":20955,"33121":20972,"33122":20988,"33123":21003,"33124":21012,"33125":21013,"33126":21024,"33127":21035,"33128":21049,"33129":21071,"33130":21105,"33131":21136,"33132":21138,"33133":21140,"33134":21148,"33135":21167,"33136":21173,"33137":21200,"33138":21248,"33139":21255,"33140":21284,"33141":21318,"33142":21343,"33143":21395,"33144":21424,"33145":21469,"33146":21539,"33147":21584,"33148":21585,"33149":21642,"33150":21661,"33185":21667,"33186":21684,"33187":21712,"33188":21795,"33189":21823,"33190":21836,"33191":21843,"33192":21853,"33193":21868,
@robinst
robinst / docker-build.txt
Created December 14, 2016 06:51
docker build output for centos:7
Sending build context to Docker daemon 2.048 kB
Step 1/2 : FROM centos:7
---> 980e0e4c79ec
Step 2/2 : RUN yum -y install gcc libmemcached-devel
---> Running in d3b9a6f526d7
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: mirror.nsw.coloau.com.au
* extras: mirror.nsw.coloau.com.au
* updates: mirror.nsw.coloau.com.au