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 / 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 / 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()

Keybase proof

I hereby claim:

  • I am sergeylukin on github.
  • I am sergeylukin (https://keybase.io/sergeylukin) on keybase.
  • I have a public key ASAT5Q5Fzp-1mB8mJYAXvkD_DA4ifS2gloH3vCl-CMDa1Qo

To claim this, I am signing this object:

<?php
define('MY_APP_DIR', __DIR__ . '/src');
function rsearch($folder, $pattern) {
$dir = new RecursiveDirectoryIterator($folder);
$ite = new RecursiveIteratorIterator($dir);
$files = new RegexIterator($ite, $pattern, RegexIterator::GET_MATCH);
$fileList = array();
foreach($files as $file) {
@sergeylukin
sergeylukin / error_handler_slack.php
Created November 4, 2018 16:19
Sends error to Slack via Webhook
<?php
// Set your Slack WEBHOOK here
define('_SLACK_ERRORS_CHANNEL_WEBHOOK_URL', '<WEBHOOK>');
// Register function that will be executed in the end of PHP runtime
register_shutdown_function("shutdown_error_handler");
/*
* Sends a message to channel on Slack, example:
@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 / test.json
Created April 3, 2018 19:35
testing rtl values
{
"ch1": 1,
"ch2": 1,
"ch3": 1,
"title": "כפר סבא",
"ch4": 1,
"ch5": 1,
"ch6": 1,
"ch7": 1,
"ch8": 1,