Skip to content

Instantly share code, notes, and snippets.

View sequencerr's full-sized avatar
👨‍💻

sequencerr

👨‍💻
  • 03:50 (UTC +01:00)
View GitHub Profile
@manast
manast / interval.js
Last active October 10, 2024 16:33
Accurate Javascript setInterval replacement
function interval(duration, fn){
var _this = this
this.baseline = undefined
this.run = function(){
if(_this.baseline === undefined){
_this.baseline = new Date().getTime()
}
fn()
var end = new Date().getTime()
@akamch
akamch / russian-colemak.el
Created May 12, 2012 22:42
Кириллическая раскладка в Emacs для систем с Colemak
; Citing http://www.emacswiki.org/emacs/WritingRussianWithDvorak:
; "As you know, all the cyrillic InputMethods work in a way that assumes your keyboard is in QWERTY layout. However,
; if you’re using dvorak keyboard layout, you may discover that, for example, cyrillic-jcuken input method can’t work ; properly since all the ascii symbols on your keyboard are mapped to appropriate cyrillic ones according to the
; qwerty->jcuken translation rules.
; Thus, one of the possible solutions is to define your own input method which translate symbols according to
; dvorak->jcuken rules."
;
; Это такой input method, только для Colemak.
; Нужно положить этот файл в ~/.emacs.d и вставить в ~/.emacs строки:
; (load-file "~/.emacs.d/russian-colemak.el")
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active October 29, 2025 00:22
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mjackson
mjackson / color-conversion-algorithms.js
Last active October 10, 2025 15:08
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@slowkow
slowkow / ssh-tutorial.md
Last active February 22, 2025 11:28
ssh to a server without typing your password

How to ssh to a remote server without typing your password

Save yourself a few keystrokes. Follow the steps below:

  1. Run this Bash script on your laptop:

    #!/usr/bin/env bash
    

The hostname of your remote server.

@pmuellr
pmuellr / cpu-percent.js
Created April 12, 2016 14:59
get CPU usage percent for a process in node, using proposed `process.cpuUsage()` function
'use strict'
// see: https://github.com/nodejs/node/pull/6157
var startTime = process.hrtime()
var startUsage = process.cpuUsage()
// spin the CPU for 500 milliseconds
var now = Date.now()
while (Date.now() - now < 500)
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active October 28, 2025 20:11
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
export class HighResolutionTimer {
private totalTicks = 0;
private timer: number | undefined;
private startTime: number | undefined;
private currentTime: number | undefined;
private deltaTime = 0;
constructor(public duration: number, public callback: (timer: HighResolutionTimer) => void) {
}
@mthomes
mthomes / _easings.css
Last active January 7, 2025 15:56
Cubic bezier presets and variables
:root {
/* Standard Curves */
--LINEAR : cubic-bezier(0.250, 0.250, 0.750, 0.750);
--EASE : cubic-bezier(0.250, 0.100, 0.250, 1.000);
--EASE_IN : cubic-bezier(0.420, 0.000, 1.000, 1.000);
--EASE_OUT : cubic-bezier(0.000, 0.000, 0.580, 1.000);
--EASE_IN_OUT : cubic-bezier(0.420, 0.000, 0.580, 1.000);
/* Ease IN curves */
@zmts
zmts / tokens.md
Last active October 25, 2025 22:59
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов