Skip to content

Instantly share code, notes, and snippets.

View sergeylukin's full-sized avatar
🎯
Focusing

Sergey Lukin sergeylukin

🎯
Focusing
View GitHub Profile
@sergeylukin
sergeylukin / error_handler_slack.php
Created October 17, 2018 12:22
Send PHP fatal errors to Slack
<?php
register_shutdown_function("shutdown_error_handler");
function FriendlyErrorType($type)
{
switch($type)
{
case E_ERROR: // 1 //
return 'E_ERROR';
case E_WARNING: // 2 //
@sergeylukin
sergeylukin / english.md
Last active December 25, 2022 22:22
Phrases I want to remember

...because you have a fit if he says "I had lunch today with Linda" (source)

glTF8ÄòJSON{"asset":{"version":"2.0","generator":"THREE.GLTFExporter"},"scenes":[{"name":"AuxScene","nodes":[0]}],"scene":0,"nodes":[{"mesh":0}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":221652,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":221652,"byteLength":73884,"target":34962,"byteStride":4},{"buffer":0,"byteOffset":295536,"byteLength":221652,"target":34962,"byteStride":12},{"buffer":0,"byteOffset":517188,"byteLength":38720,"target":34963}],"buffers":[{"byteLength":555908}],"accessors":[{"bufferView":0,"componentType":5126,"count":18471,"max":[43.336090087890625,3,17.451862335205078],"min":[-19.43631362915039,0,-17.475122451782227],"type":"VEC3"},{"bufferView":1,"componentType":5125,"count":18471,"max":[10071],"min":[51],"type":"SCALAR"},{"bufferView":2,"componentType":5126,"count":18471,"max":[1,1,1],"min":[-1,-1,-1],"type":"VEC3"},{"bufferView":3,"componentType":5123,"count":19359,"max":[18470],"min":[0],"type":"SCALAR"}],"materials":[{"pbrMetallicRoughness":{"metallicFa
@sergeylukin
sergeylukin / forloop
Created September 24, 2022 22:29
alternative for for (let i =0; i < len; i++ ) { ... }
const len = 20
const users = Array.apply(null, Array(len)).map(() => {
doSomething()
})
@sergeylukin
sergeylukin / make.conf
Created November 19, 2013 15:08
Optimized system-wide makefile for FreeBSD. Saved in /etc/make.conf
# default to -j6 for make
FORCE_MAKE_JOBS=yes
MAKE_JOBS_NUMBER=6
# specific options/etc for ports
.if ${.CURDIR:M*/databases/mysql*-server}
BUILD_OPTIMIZED=yes
.endif
# static zsh build for root
@sergeylukin
sergeylukin / .vimrc
Created July 3, 2014 23:05
Minimal vim configuration for root user
" This is my minimal Vim configuration file I usually save as `/root/.vimrc`
" for the occasions when I'm logged in as root user and I need to edit files
" (this doesn't usually happen, but when it happens, I have vim configuration
" that makes sense).
"
" It doesn't require any plugins and aims to work with minimal Vim installation
"
" Forget compatibility with VI
set nocompatible
@sergeylukin
sergeylukin / HttpLink.mq4
Last active October 19, 2021 13:27
Opening a Webpage in the default browser from within MetaTrader
@sergeylukin
sergeylukin / twom.sh
Created October 13, 2015 04:27
Save and load progress in "This War of Mine" video game
#!/bin/bash
# Copyright (c) 2015 gruberator
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the gruberator. The name of the
@sergeylukin
sergeylukin / install
Created June 24, 2020 19:31
Install Jenkins via Docker on OS X
docker run -d -p 8080:8080 jenkins/jenkins
docker ps
# Install docker-enter function:
# docker-enter() {
# docker exec -it "$@" bash
# }
docker-enter <container_id>
@sergeylukin
sergeylukin / init.lua
Last active November 5, 2019 08:17
Hammerspoon Hyper key configuration
--Reload config
local hyper = { "cmd", "alt", "ctrl", "shift" }
hs.hotkey.bind(hyper, "0", function()
hs.reload()
hs.notify.new({title="Hammerspoon", informativeText="Config loaded"}):send()
end)
--Resize windiows
hs.window.animationDuration = 0
hs.hotkey.bind(hyper, "h", function()