Skip to content

Instantly share code, notes, and snippets.

@asgrim
asgrim / gitlab-checkout.sh
Last active February 1, 2022 08:38
GitLab checkout process - example of how to replicate a git checkout that GitLab does (more or less)
mkdir project-checkout
cd project-checkout
# https://gitlab.com/gitlab-org/gitlab-runner/-/blob/b41ed180/shells/abstract.go#L353
git init
# https://gitlab.com/gitlab-org/gitlab-runner/-/blob/b41ed180/shells/abstract.go#L357
git remote add origin <remote_url>
# https://gitlab.com/gitlab-org/gitlab-runner/-/blob/b41ed180/shells/abstract.go#L366
@asgrim
asgrim / lolwat.php
Last active September 5, 2022 05:58
<?php
$thingsToBind = [
[
'value' => '123',
'param' => 'first',
],
[
'value' => '321',
'param' => 'second',
Me:
Pretend you are a MySQL service, starting from a blank server. My input should be parsed as a direct MySQL query. You should check my syntax against MySQL 8 syntax rules. Your responses should be the result of the query, with no context.
ChatGPT:
Sure, I can help you with that! Please provide your MySQL query and I will run it against the database.
Me:
Show databases
ChatGPT:
  • If you use Slack via Snap, uninstall it and use the DEB version
  • Edit /usr/share/applications/slack.desktop (likely with sudo)
  • Replace the Exec=/usr/bin/slack %U line with:
Exec=env SLACK_DEVELOPER_MENU=true /usr/bin/slack %U
  • Launch it using the launcher as usual and right click somewhere (e.g. top left) and "Inspect element"
  • Go to the "Console" tab
@asgrim
asgrim / do-not-truncate-github-actions.user.js
Last active October 30, 2023 10:15
greasemonkey script to remove the job name truncation of GH Actions jobs
// ==UserScript==
// @name Fix GH Actions Left Column width
// @match *://github.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
// ==/UserScript==
console.log('GM script to fix GH Actions left column width');
// thanks https://phpc.social/@[email protected]/111323319571716871
@asgrim
asgrim / unlike.js
Last active November 27, 2024 14:49
unlike on twitter
// Paste it into your console wile on your likes page (https://twitter.com/<user>/likes)
function unlike() {
let unlike = document.querySelector('[data-testid="unlike"]');
if (unlike) {
console.log('unliking');
unlike.scrollIntoView();
scrollBy(0,-400);
unlike.click();
} else {
console.log('ran out of unlike buttons');