Skip to content

Instantly share code, notes, and snippets.

View ziadoz's full-sized avatar

Jamie York ziadoz

View GitHub Profile
@jwbee
jwbee / jq.md
Last active July 14, 2025 14:08
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@roshanmirajkar
roshanmirajkar / TwitterFollowingCSV.js
Created December 31, 2023 02:21
Twitter Following List Exporter
/*
Collect and export a list of Twitter usernames you're following, along with follow-back status, to a CSV file every 80 seconds. Done client-side using Javascript running in the Console window of the web browser.
Instructions:
1) Modify the 'LANGUAGE' variable to match your Twitter interface language.
2) Customize 'SKIP_USERS' with usernames you do not wish to include in the CSV.
3) 'PRINT_FOLLOW_INFORMATION' determines whether follow-back status is included.
4) 'SKIP_FOLLOWERS' and 'SKIP_NON_FOLLOWERS' settings filter out respective user groups.
5) 'MS_PER_CYCLE' controls the frequency of data collection cycles.
6) Load the Twitter page showing users you're following, open the console (F12), paste this code, and run it.
@frederikheld
frederikheld / create-releases-from-old-commits.md
Created October 4, 2023 12:45
Create releases from old commits

If you create a new release in GitHub, you will either create a new tag (which will point to the most recent commit on main) or choose an existing tag (that might point to an older commit).

If you want to create releases from old commits (e.g. because you forgot to create a realease or didn't work with releases back then), there is a problem with this: when creating a tag for a specific commit in the past, GitHub only lets you pick from the most recent commits, so the commit you want to tag will not show up in the list.

Luckily, you can tag older commits locally [1]:

  1. Find the commit on GitHub. If it is from a Pull Request, you can look into the closed Pull Requests. Within the PR you'll find a link to the commit.
  2. Copy the commit hash from yo
// ==UserScript==
// @name TweetXer
// @namespace https://github.com/lucahammer/tweetXer/
// @version 0.9.3
// @description Delete all your Tweets for free.
// @author Luca,dbort,pReya,Micolithe,STrRedWolf
// @license NoHarm-draft
// @match https://x.com/*
// @match https://mobile.x.com/*
// @match https://twitter.com/*
@msanders
msanders / old-reddit-redirect.user.js
Last active February 21, 2024 14:22
Userscript: Old Reddit Redirect
// ==UserScript==
// @name Old Reddit Redirect
// @description Redirects www.reddit.com to the old version of the website
// @downloadURL https://gist.githubusercontent.com/msanders/52700d5c5ed76f1114594ddb862b530e/raw/old-reddit-redirect.user.js
// @updateURL https://gist.githubusercontent.com/msanders/52700d5c5ed76f1114594ddb862b530e/raw/old-reddit-redirect.user.js
// @version 2023.10.19
// @run-at request
// ==/UserScript==
[
@davidedmundson
davidedmundson / PlasmaNested.sh
Last active June 14, 2025 02:47
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@ziadoz
ziadoz / Laravel-Container.md
Last active June 19, 2025 09:47 — forked from zhilinskiy/Laravel-Container.md
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@bennlee
bennlee / wildcards-in-paths.md
Last active December 19, 2024 08:02
What does the double asterisk(**) mean in the path?

What does the double asterisk(**) mean in the path?

There's two meaning of wildcards in paths for file collections.

  • * is a simple, non-recursive wildcard representing zero or more characters which you can use for paths and file names.
  • ** is a recursive wildcard which can only be used with paths, not file names.

For examples,

  • /var/log/** will match all files in /var/log and all files in all child directories, recursively.
  • /var/log/**/*.log will match all files whose names end in .log in /var/log and all files in all child directories, recursively.
  • /home/*/.bashrc will match all .bashrc files in all user's home directories.
@MattApril
MattApril / ConsoleSchedulingTest.php
Last active July 4, 2024 09:25
A simple way of testing that your Lumen commands are scheduled exactly when and how you expect. This approach does not trigger commands to actually execute, which is what a lot of other suggestions do.
<?php
use App\Console\Kernel;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Event;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Collection;
class ConsoleSchedulingTest extends TestCase
{