Skip to content

Instantly share code, notes, and snippets.

@vomnes
vomnes / a-server.go
Last active May 14, 2024 17:09
Minimalist TCP server/client in Go using only syscalls - Select() to handle file descriptors
package main
import (
"fmt"
"log"
"golang.org/x/sys/unix"
)
// https://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets
@noraj
noraj / gulp-cjs-to-esm.md
Last active May 14, 2024 17:07
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

@krisleech
krisleech / 00-NOTES.md
Last active May 14, 2024 17:06
Notes on Clojure ring handlers and middleware

Ring handler a function which accepts a request (map) and returns a response (map).

Ring middleware

function (handler, &args -> function(request -> response) because it is a closure handler and &args are in scope within the returned handler function.

a function which accepts a "next handler" (the next handler in the chain) + any extra arguments and returns a handler (function), which will accept a request and return a response.

@luizomf
luizomf / README.md
Last active May 14, 2024 17:06
Useful Linux/Unix commands.

Se você usa MacOS

O macOs roda sobre Darwin OS (kernel XNU), que é um sistema UNIX-like. Então, todos os comandos abaixo também funcionam normalmente no MacOS. Recomendo utilizar o gerenciador de pacotes homebrew caso necessário instalar algo. Se quiser o mesmo terminal que eu (ZSH com Oh My ZSH), utilize este vídeo para configurar https://youtu.be/bs1-Wxb_KIc

Se você usa Windows

No Windows é possível utilizar o wsl2 e instalar uma versão do linux para acompanhar. Eu fiz alguns vídeos para você usar o Linux no Windows.

@calaway
calaway / git_workflow_best_practices.md
Last active May 14, 2024 17:05
Git Workflow Best Practices

Git Branch Merging Best Practices

  1. After you've selected a feature to work on, create a branch in your local repo to build it in.
    • $ git checkout -b calaway/short_description_of_feature
  2. Implement the requested feature, make sure all tests are passing, and commit all changes in the new branch.
  3. Checkout the master branch locally.
    • $ git checkout master
  4. Pull down the master branch from GitHub to get the most up to date changes from others. If you practice git workflow as described here you should never have a merge conflict at this step.
    • $ git pull origin master
  5. Make sure all tests are passing on master and then checkout your new branch.
  • $ git checkout calaway/short_description_of_feature
@ih2502mk
ih2502mk / list.md
Last active May 14, 2024 17:05
Quantopian Lectures Saved
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 14, 2024 17:03
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@avelino
avelino / gist:3188137
Created July 27, 2012 13:49
shell script, como colorir o retorno do seu código
echo -e " \033[0;30m Preto \033[0m --> 0;30 "
echo -e " \033[0;31m Vermelho \033[0m --> 0;31 "
echo -e " \033[0;32m Verde \033[0m --> 0;32 "
echo -e " \033[0;33m Marrom \033[0m --> 0;33 "
echo -e " \033[0;34m Azul \033[0m --> 0;34 "
echo -e " \033[0;35m Purple \033[0m --> 0;35 "
echo -e " \033[0;36m Cyan \033[0m --> 0;36 "
echo -e " \033[0;37m Cinza Claro \033[0m --> 0;37 "
echo -e " \033[1;30m Preto Acinzentado \033[0m --> 1;30 "
echo -e " \033[1;31m Vermelho Claro \033[0m --> 1;31 "
@rsms
rsms / macos-distribution.md
Last active May 14, 2024 17:01
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@bruvv
bruvv / Repair synology BTRFS volume
Created December 6, 2019 18:12
Synology BTRFS repair
btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h