Skip to content

Instantly share code, notes, and snippets.

@tinrab
tinrab / action.ts
Last active May 5, 2024 00:21
Calling server actions in client form components
'use server';
export const signUpAction = apiAction(
signUpFormSchema,
async (data): Promise<{ }> => {
// ...
},
);
@rmetzler
rmetzler / gist:2947828
Created June 18, 2012 10:43
find all non UTF-8 encoded files
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail
@maratori
maratori / .golangci.yml
Last active May 5, 2024 00:18
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.58.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 00:17
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@NachoHumanNow
NachoHumanNow / nuvo
Created April 1, 2023 11:41
Nuvo Editor
https://github.com/novuhq/novu/blob/main/providers/netcore/package.json

So, You Want to be a Systems Engineer

Systems Engineering (also known as Infrastructure Engineering, Operations Engineering, or DevOps) is a challenging but rewarding career path. Because Systems Engineering draws from a wide variety of smaller topics, it can be hard to know where to start and in what order to begin. This resource is intended to give you a sketch of some of the learning-paths that that can lead you to a career in Systems Engineering.

What do I need to know?

To start, let's examine a high-level list of topics that established systems engineers should have knowledge of. In each of these topics, the level of depth required to get started as a systems engineer may vary, but it's good to have a general breadth of knowledge on all of these topics.

These lists are not exhaustive, rather a good starting point to gain general knowledge.

@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@aike
aike / chorddetector.ksp
Created May 3, 2024 00:47
Chord detection KONTAKT script
{ Chord detection KONTAKT script by aike }
{ This program is licensed under MIT License. }
on init
set_ui_height_px(470)
set_ui_width_px(970)
make_perfview
set_script_title("main")
set_control_par_str($INST_WALLPAPER_ID, $CONTROL_PAR_PICTURE, "panel")
set_skin_offset(0)
@chenxiaolong
chenxiaolong / example.yaml
Created July 19, 2023 00:53
Custom Ansible module to manage the entire VyOS config
---
- hosts: vyos
vars:
# This would ideally go in the host vars.
vyos_config:
# ...
# The structure is identical to what `show configuration json pretty` in
# operational mode produces. For the vast majority of VyOS commands, the
# command <-> JSON translation is 1:1. For example, the command:
#
@vasanthk
vasanthk / System Design.md
Last active May 5, 2024 00:11
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?