Skip to content

Instantly share code, notes, and snippets.

View defun99's full-sized avatar
πŸ‘Ύ
γ“γ‚“γ«γ‘γ―δΈ–η•Œ

Nikita Rychagov defun99

πŸ‘Ύ
γ“γ‚“γ«γ‘γ―δΈ–η•Œ
View GitHub Profile
@montanaflynn
montanaflynn / main.go
Last active May 28, 2024 04:32
Gin request timeout middleware and handler
package main
import (
"context"
"log"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
@joaomoreno
joaomoreno / README.md
Last active February 1, 2024 22:19
VS Code Insiders Updater for Linux

VS Code Insiders Updater for Linux

This script will download and replace ~/Applications/VSCode-linux-x64 with the latest VS Code Insiders.

gif

Install

  1. Install jq: https://stedolan.github.io/jq/download/
  2. Place update-code somewhere in your PATH
@joseluisq
joseluisq / inotify_arch_linux.md
Last active April 10, 2022 12:08
Increasing the amount of inotify watchers in Arch Linux

Increasing the amount of inotify watchers in Arch Linux

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Then paste it in your terminal and press on enter to run it.

@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@quangnd
quangnd / reduceExamples.js
Last active November 24, 2023 19:57
Some examples about reduce() in Javascript
//Example 1 - Calculate average value of an array (transform array into a single number)
var scores = [89, 76, 47, 95]
var initialValue = 0
var reducer = function (accumulator, item) {
return accumulator + item
}
var total = scores.reduce(reducer, initialValue)
var average = total / scores.length
/*Explain about function
@wojteklu
wojteklu / clean_code.md
Last active October 20, 2025 14:57
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

@hiroakioishi
hiroakioishi / PoissonDiskSampler3D.cs
Last active April 7, 2025 08:15
Implementation of Poisson Disk Sampling for 3D
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// Implementation for 3D from Gregory Schlomoff's Unity source: http://gregschlom.com/devlog/2014/06/29/Poisson-disc-sampling-Unity.html
///
/// Usage:
/// PoissonDiskSampler3D sampler = new PoissonDiskSampler3D(10, 5, 7.5f, 0.3f);
/// foreach (Vector3 sample in sampler.Samples()) {
/// // ... do something, like instantiate an object at (sample.x, sample.y, sample.z) for example:
@WilliamQLiu
WilliamQLiu / index.html
Created November 17, 2014 20:25
D3 Mouse Events
<!DOCTYPE html>
<!-- How to create Mouse Events for D3 -->
<html>
<head>
<!-- Load D3 from site -->
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<!-- CSS (Styling) -->
<style type="text/css">
@eweitnauer
eweitnauer / README.md
Last active February 4, 2021 13:20
Fast Scrolling using D3

Scrolling through big amounts of time series data.

In fast mode, scrolling is achieved by moving a parent "g" element to the left or right. Entering and exiting of data is done at the end of dragging. In slow mode, entering, exiting and updating of data is done during the dragging.

@staltz
staltz / introrx.md
Last active October 21, 2025 02:57
The introduction to Reactive Programming you've been missing