Skip to content

Instantly share code, notes, and snippets.

@nikes
nikes / comment-example.js
Created October 29, 2021 08:09 — forked from brandongoode/comment-example.js
Dynamoose range and hash key example
var commentSchema = new Schema({
postId: {
type: String,
hashKey: true
},
id: {
type: String,
rangeKey: true,
default: shortId.generate
@nikes
nikes / gist:7bb67bc1ca8abe377dd2ea6ab189698e
Created December 11, 2021 10:48 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nikes
nikes / phoneMasks.json
Created July 21, 2022 09:55 — forked from mikemunsie/phoneMasks.json
Phone Masks by Country Code JSON
{
"AC": "+247-####",
"AD": "+376-###-###",
"AE": "+971-5#-###-####",
"AE": "+971-#-###-####",
"AF": "+93-##-###-####",
"AG": "+1(268)###-####",
"AI": "+1(264)###-####",
"AL": "+355(###)###-###",
"AM": "+374-##-###-###",
@nikes
nikes / registry-codec.nbt
Created September 15, 2022 16:51
The Minecraft 1.19.2 Registry Codec
{
'minecraft:chat_type': {
type: 'minecraft:chat_type',
value: [
{
element: {
chat: {
parameters: ['sender', 'content'],
translation_key: 'chat.type.text',
},
@nikes
nikes / registry-codec.json
Created September 15, 2022 16:57
The Minecraft 1.19.2 Registry Codec (JSON)
{
"minecraft:chat_type": {
"type": "minecraft:chat_type",
"value": [
{
"element": {
"chat": {
"parameters": [
"sender",
"content"
@nikes
nikes / MinecraftService.md
Created October 8, 2022 18:40 — forked from dotStart/MinecraftService.md
Systemd services for Minecraft Servers

Minecraft systemd Services

This gist contains service descriptors which may be used to automatically start and re-start Minecraft servers using systemd. This allows proper control of your server startup on modern Linux distributions and will automatically manage all required tasks on startup for you.

Requirements

@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)',
@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;
Полезные ключи программы psql
-U - Указываем пользователя, например postgres
-W - Приглашение на ввод пароля
-d название_БД - Подключение к БД название_БД
-h имя_хоста - Подключение к хосту имя_хоста
-p порт - По какому порту постгря ожидает подключения
-c команда - Выполнение команды SQL без выхода в интерактивный режим
-f file.sql - Выполнение команд из файла file.sql
-S - Однострочный режим, то есть, переход на новую строку будет выполнять запрос (избавляет от ; в конце конструкции SQL)
@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);