Skip to content

Instantly share code, notes, and snippets.

@Tynael
Tynael / settings.json
Created April 25, 2023 18:30
VS Code Better Comments Extension - Create your own comment styles
"better-comments.tags": [
// Other tags here...
{
"tag": "<>",
"color": "#2596be",
"strikethrough": false,
"underline": true,
"backgroundColor": "transparent",
"bold": true,
"italic": false
@Tynael
Tynael / digit_separator.cpp
Created November 20, 2022 14:47
Make Large Numbers Easier to Read
#include <iostream>
using namespace std;
int main()
{
long long int num1 = 1'23'456;
long long int num2 = 12'34'56;
long long int num3 = 123'456;
return 0;
@unique1984
unique1984 / symfony
Last active November 16, 2023 01:09
Symfony Cli bash-completion
_symfony()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local cmd="${COMP_WORDS[0]}"
if ($cmd > /dev/null 2>&1)
then
COMPREPLY=($(compgen -W "$($cmd --help --no-ansi | grep -v 'Available\|Global\|Usage:\|Runs\|Environment' | grep ':' | awk '{print $1}' | grep -Poi '^\K[\w:-]+') new serve server:stop security:check composer console login link projects envs env:create tunnel:open ssh deploy domains vars user:add help" -- $cur))
fi
}
complete -F _symfony symfony

Shared indexes with Coder

TLDR: Shared indexes work with Coder + JetBrains Projector. To quickly prototype your project with shared indexes, you can generate them and host them as a dev URL on your workspace, for other workspaces to try.

After testing, you'll need to upload the contents of /home/coder/indexes/generate-output to a file server and use that as the index location, or include them in the Coder image's filesystem. Dev URLs are used simply as a test. You'll need to regenerate the metadata with cdn-layout-tool with the proper destination as well.

Generating a shared index in a Coder workspace:

Sourced from this tutorial: https://www.jetbrains.com/help/go/shared-indexes.html#configure-index-update

@yokawasa
yokawasa / ghcr.md
Last active June 19, 2024 22:04
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@jakub-g
jakub-g / github-code-search-syntax.md
Created February 17, 2021 08:13
Searching files on GitHub

GitHub search docs: here

  • org:ORGNAME to filter down to org
  • org:ORGNAME -repo:ORGNAME/NOISY to filter out some repos
  • path:PATH to search by location
  • language:... or extension:... to filter by lang/extension
  • in:file, in:path, in:file,path to include contents or file paths
@shivanshs9
shivanshs9 / rename-database.sql
Created April 16, 2020 11:15
Rename MySQL Database
DROP PROCEDURE IF EXISTS moveTables;
DROP PROCEDURE IF EXISTS renameDatabase;
DELIMITER $$
CREATE PROCEDURE moveTables(_schemaName varchar(100), _newSchemaName varchar(100))
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE table_name VARCHAR(64);
DECLARE table_cursor CURSOR FOR SELECT information_schema.tables.table_name FROM information_schema.tables
WHERE information_schema.tables.table_schema = _schemaName;
@derickr
derickr / .bashrc-section.sh
Last active April 20, 2020 13:56
Colourful bashrc PHP and Xdebug prompt
function _php_prompt() {
local php_v="`php -n -v 2>&1`"
local php_status="`echo "${php_v}" | head -n 1 | cut -d " " -f 2`"
local php_zts="`echo "${php_v}" | head -n 1 | grep ZTS`"
local php_debug="`echo "${php_v}" | head -n 1 | grep DEBUG`"
local php_64="`php -n -r 'echo PHP_INT_SIZE == 4 ? "32" : "64";' 2>&1`"
local flag1="`set | egrep '^(USE_ZEND_ALLOC=0)'`"
local flag2="`set | egrep '^(ZEND_DONT_UNLOAD_MODULES=1)'`"
flags=" "
@lyrixx
lyrixx / .gitignore
Last active July 28, 2023 14:13
UUID generation in PHP
/vendor/