Skip to content

Instantly share code, notes, and snippets.

View sudofox's full-sized avatar
🕟
turning back the clock

Austin Burk sudofox

🕟
turning back the clock
View GitHub Profile
@sudofox
sudofox / perl_hashref_array_filter.pl
Created November 30, 2022 18:40
filter an array of hashrefs for only the fields i want
# as function
sub filter { my $fields = shift; my @results = @_; foreach my $result (@results) { my $replacement = {}; foreach my $field (@$fields) { $replacement->{$field} = $result->{$field}; } $result = $replacement; } return @results; }
# as anonymous func
my $filter = sub {my $fields = shift; my @results = @_; foreach my $result (@results) {my $replacement = {}; foreach my $field (@$fields) {$replacement->{$field} = $result->{$field};} $result = $replacement;} return @results;};
# usages
my @results = $filter->([qw/metadata uuid/], $object->attribute->asHashRefs);
my @results = filter([qw/metadata uuid/], $object->attribute->asHashRefs);
@MidSpike
MidSpike / readme.md
Last active February 5, 2024 18:09
CVE-2022-23812 | RIAEvangelist/node-ipc is malware / protest-ware
@wktk
wktk / humanity-solver.user.js
Last active December 21, 2023 08:04
はてラボ人間性センター自動入力
// ==UserScript==
// @name Humanity Solver
// @version 1
// @grant none
// @include http://human.hatelabo.jp/quiz?*
// @include https://human.hatelabo.jp/quiz?*
// ==/UserScript==
// 下記URLを参考に過不足分を補正したもの
// https://web.archive.org/web/20210104141218/https://anond.hatelabo.jp/20210104230501
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@noromanba
noromanba / hatenahaiku-spam-filter.user.js
Last active September 21, 2018 17:25
Hatena Haiku spam filter for UserScript
// ==UserScript==
// @name Hatena Haiku spam filter
// @namespace https://noromanba.github.com
// @description Hatena Haiku spam filter for UserScript
// @include *://h.hatena.ne.jp/*
// @exclude *://h.hatena.ne.jp/setting/*
// @exclude *://h.hatena.ne.jp/guide
// @exclude *://h.hatena.ne.jp/help/*
// @grant none
// @noframes
@janjouketjalsma
janjouketjalsma / twig-translated-timediff-array-configuration.php
Last active December 3, 2020 16:40
Translate twig date extension (time_diff filter) to Dutch (Nederlands) using array loader in a custom non-symfony application
<?php
// Create translator for date diff
$translator = new Symfony\Component\Translation\Translator('nl_NL');
$translator->addLoader('array', new Symfony\Component\Translation\Loader\ArrayLoader());
$translator->addResource('array', array(
'diff.ago.second' => 'een seconde geleden|%count% seconden geleden',
'diff.ago.minute' => 'een minuut geleden|%count% minuten geleden',
'diff.ago.hour' => 'een uur geleden|%count% uur geleden',
'diff.ago.day' => 'een dag geleden|%count% dagen geleden',
'diff.ago.month' => 'een maand geleden|%count% maanden geleden',
@jaames
jaames / flipnote_studio_ui_strings.md
Created April 2, 2018 16:04
UI strings from Flipnote Studio for the Nintendo DSi

Message and layout text parsed from Flipnote Studio's .tbl and .bmg files.

Layout

Index ID Attr Message
0000 BackButton_BackButtonText 0x05 Back
0001 BackButton_SaveButtonText 0x05 Save
0002 BirthDay_BirthDayTitleDayText 0x06 Day
0003 BirthDay_BirthDayTitleMonthText 0x06 Month
@air
air / try_realms_api.sh
Last active June 17, 2022 02:19
Let's use the Realms API to download our world backup!
#!/bin/bash
# you need httpie (apt-get install httpie)
# you need to replace <these things> with your details
# run with 'source' to export vars to your shell for experimentation
# 1. authenticate to get an access token
auth_server=https://authserver.mojang.com
user=<your login email>
@Derpidoo
Derpidoo / led_strip_controller_44button_remote_protocol.txt
Last active March 15, 2024 22:13
RGB LED Strip Controller 44 Button IR Remote Codes
RGB LED Strip Controller w/44 Button IR Remote Protocol
E.g. https://www.amazon.com/Flexible-Changing-Non-Waterproof-Controller-Included/dp/B01EWBZW0A/
"Hue hue hue" -you, after saving hundreds on your smart lighting
IR Wavelength: 940nm
Code Type: NEC
Code Length: 32 bit
## Function Code
===.====================.=======
@p3t3r67x0
p3t3r67x0 / openssl_commands.md
Last active February 3, 2024 18:53
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl