Skip to content

Instantly share code, notes, and snippets.

@nikes
nikes / WinView.ahk
Last active April 15, 2024 17:37
AutoHotkey v2.0 - remap Win to Win+Tab aka Exposé
#Requires AutoHotkey v2.0
LWin:: {
Send "{LWin Down}{Tab}"
WinTabMenu := true
}
; The #HotIf directive creates context-sensitive hotkeys and hotstings:
#HotIf (WinTabMenu := true) ; If this variable has the value "true"
@nikes
nikes / finding_twitter_user_id.md
Created January 2, 2024 12:00 — forked from kentbrew/finding_twitter_user_id.md
Finding Twitter User IDs

Finding Twitter User IDs

User accounts on Twitter are commonly identified by screen name, which may be changed by operators when they take over an account, or have been sitting on an old account for a long time and want to transition it into malicious use.

User IDs, however, are permanent. There are several services out there that will try to find them for you but it seems like a bad idea to me, since you're alerting them to the fact that there's something interesting about this account. There's also plenty of bad advice that uses many long-since-abandoned Twitter API endpoints.

As of this writing (2018-02-18) you can view source and search for /profile_banners/, which will show something like this:

.enhanced-mini-profile .mini-profile .profile-summary {
@nikes
nikes / README.md
Created October 13, 2023 17:20 — forked from robertkirkman/README.md
How to record or stream SteamOS 3.5 Gaming Mode

How to record or stream SteamOS 3.5 in gamescope (Gaming Mode)

Here is another method that uses Flatpak and obs-vkcapture, which don't meet my personal needs but are very likely to be useful for you. In the comments there there is also an obs-gstreamer method.

Here is another method for recording that has its own GUI for Gaming Mode built with Decky Loader.

Prerequisites for all methods shown here

  1. Set a password (if you haven't already) and disable read-only rootfs (yes this means after updating SteamOS [not Steam Client] this will all be deleted and you will have to do all this again if you want to stream again)
@nikes
nikes / steamdeck_ssh_instructions.md
Created October 13, 2023 16:50 — forked from andygeorge/steamdeck_ssh_instructions.md
Steam Deck `ssh` instructions

These are manual instructions on enabling SSH access on your Steam Deck, adding public key authentication, and removing the need for a sudo password for the main user (deck).

This gist assumes the following:

  • you have a Steam Deck
  • you have a home PC with access to a Linux shell that can ssh, ssh-keygen, and ssh-copy-id
  • your Steam Deck and home PC are on the same local network, with standard SSH traffic (tcp/22) allowed over that network from the PC to the Steam Deck

NOTE: @crackelf on reddit mentions that steamOS updates blow away everything other than /home, which may have the following effects:

  • removing the systemd config for sshd.service, which would prevent the service from automatically starting on boot
  • removing the sudoers.d config, which would reenable passwords for sudo

Ports used

Some of the exact port numbers seem to be different between installations. I'm not sure if any have to be as listed, but those were a working number I used at some point

Port Description Place Defined Open Port Unique
11000 Overworld server port Master/server.ini x x
11001 Cave server port Caves/server.ini x x
8768 Steam auth port for overworld Master/server.ini
8769 Steam auth port for cave Caves/server.ini
27018 Steam master server port for overworld Master/server.ini x

Ports used

Some of the exact port numbers seem to be different between installations. I'm not sure if any have to be as listed, but those were a working number I used at some point

Port Description Place Defined Open Port Unique
11000 Overworld server port Master/server.ini x x
11001 Cave server port Caves/server.ini x x
8768 Steam auth port for overworld Master/server.ini
8769 Steam auth port for cave Caves/server.ini
27018 Steam master server port for overworld Master/server.ini x
@nikes
nikes / db.ts
Created June 22, 2023 15:51 — forked from rphlmr/clear-db.ts
Drizzle snippets
import { sql } from "drizzle-orm";
import { type Logger } from "drizzle-orm/logger";
import { drizzle, type PostgresJsDatabase } from "drizzle-orm/postgres-js";
import postgres from "postgres";
class QueryLogger implements Logger {
logQuery(query: string, params: unknown[]): void {
console.debug("___QUERY___");
console.debug(query);
console.debug(params);
Полезные ключи программы psql
-U - Указываем пользователя, например postgres
-W - Приглашение на ввод пароля
-d название_БД - Подключение к БД название_БД
-h имя_хоста - Подключение к хосту имя_хоста
-p порт - По какому порту постгря ожидает подключения
-c команда - Выполнение команды SQL без выхода в интерактивный режим
-f file.sql - Выполнение команд из файла file.sql
-S - Однострочный режим, то есть, переход на новую строку будет выполнять запрос (избавляет от ; в конце конструкции SQL)
@nikes
nikes / EventSource.cs
Created March 11, 2023 21:32 — forked from igolaizola/EventSource.cs
C# implementation of Server Side Event Source
/*
* Copyright 2014 Jonathan Bradshaw. All rights reserved.
* Redistribution and use in source and binary forms, with or without modification, is permitted.
*/
using System;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Linq;
@nikes
nikes / rfc5646-language-tags.js
Created October 18, 2022 12:26 — forked from msikma/rfc5646-language-tags.js
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',