Skip to content

Instantly share code, notes, and snippets.

@raftheunis87
raftheunis87 / hyperjs.md
Last active July 17, 2025 07:10
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js

/*
Given an array of size n, find the majority element.
The majority element is the element that appears more than floor(n/2) times.
You may assume that the array is non-empty and the majority element always exist in the array.
*/
/*
This solution complexity is
worst case : o(n)
best case: o(n/2) => though it is said as o(n), there is nothing wrong to mention as n/2 in best case
const streets = [
'Абельмановская улица',
'площадь Абельмановская Застава',
'Абрамцевская просека',
'Абрамцевская улица',
'Абрикосовский переулок',
'Авангардная улица',
'улица Авиаконструктора Микояна',
'улица Авиаконструктора Миля',
'улица Авиаконструктора Сухого',
/**
* @typedef {Object} Person
* @property {String} login Идентификатор сотрудника.
* @property {Number} floor "Домашний" этаж сотрудника.
* @property {String} avatar Ссылка на аватар.
*/
/**
* @typedef {Object} Room
* @property {Number} id Идентификатор переговорки.
@Envek
Envek / rescue-from-git-push-force.md
Last active July 14, 2025 08:27
Откат ошибочной команды git push --force

Откат ошибочной команды git push --force

Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.

Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.

Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…

Но это git, а значит всё можно починить!

@kana-sama
kana-sama / 1.hs
Last active February 8, 2018 20:49
Конспект по лямбда-исчислениям
-- Истина
true === \t f -> t
-- Ложь
false === \t f -> f
-- Ветвления
@kitsguru
kitsguru / aliases
Created January 6, 2017 19:59
aliases for bash
### Aliases
## ssh to dev server
alias sshj='ssh jeff@git.dev.lan'
alias sshg='ssh git@git.dev.lan'
## project scripts
alias cnp="~/bin/createproject2.sh"
alias installPackages="~/bin/installPackages.sh"
alias installbower="~/bin/installbower.sh"
@pdanford
pdanford / README.md
Last active March 26, 2026 12:47
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


sudo curl -o /usr/local/bin/imgcat -O https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat && sudo chmod +x /usr/local/bin/imgcat
# If you have a better way to fix the permissions, comment below!