Skip to content

Instantly share code, notes, and snippets.

@karol-majewski
karol-majewski / withDefaults.tsx
Last active April 30, 2024 16:01
Functional composition for React props
import * as React from 'react';
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/**
* Supplies default props.
*/
export function withDefaults<T extends React.ComponentType<any>, U extends Partial<React.ComponentProps<T>>>(
Component: T,
defaults: U,
@brotherkaif
brotherkaif / settings.json
Created September 12, 2023 17:19
LazyVim keymappings for VSCode
{
"vim.showMarksInGutter": false,
"vim.foldfix": true,
"vim.surround": true,
"vim.easymotion": true,
"vim.easymotionKeys": "asdghklqwertyuiopzxcvbnmfj",
"vim.leader": "<space>",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [":", "w", "<CR>"],
@Pulimet
Pulimet / AdbCommands
Last active April 30, 2024 16:00
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@dopey
dopey / main.go
Last active April 30, 2024 15:59 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 30, 2024 15:57
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@lummie
lummie / enum.go
Last active April 30, 2024 15:57
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int
@nikolovlazar
nikolovlazar / keybindings.json
Created April 29, 2024 01:12
VSCode key bindings to navigate like Neovim
[
// Navigation
{
"key": "ctrl-h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl-l",
"command": "workbench.action.navigateRight"
},
atl*CLI> core show help
! -- Execute a shell command
acl show -- Show a named ACL or list all named ACLs
ael reload -- Reload AEL configuration
ael set debug {read|tokens|macros|contexts|off} -- Enable AEL debugging flags
agi dump html -- Dumps a list of AGI commands in HTML format
agi exec -- Add AGI command to a channel in Async AGI
agi set debug [on|off] -- Enable/Disable AGI debugging
agi show commands [topic] -- List AGI commands or specific help
aoc set debug -- enable cli debugging of AOC messages
@pixiesky
pixiesky / magento2.nginx.conf
Last active April 30, 2024 15:54
Magento 2.x Nginx (with PHP-FPM) development template.
# Magento 2.x Nginx (and PHP-FPM) development template. (Taken from the official repo and slightly edited)
# READ THROUGH FIRST! See video https://youtu.be/22RF1g_yjFI
# Andy Myers
upstream fastcgi_backend {
# use tcp connection
# server 127.0.0.1:9000;
# or socket
# This is different for different distrbutions
server unix:/PATH/TO/php-fpm.sock;