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 / optimg.sh
Last active July 3, 2019 07:15
Shell script for JPGs and PNGs optimization
#!/usr/bin/env sh
#
# This script automates images optimization
# is mainly used by a developer who manually
# can execute it when adding new images to the
# project
#
# Download and compile following binaries:
#
# - [jpegtran](http://www.ijg.org/)

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 / post-receive
Last active April 27, 2018 13:38
Git hook (post-receive): update working tree on PUSH
#!/bin/sh
#
# This hook is placed in Bare repository and it updates Working tree whenever a PUSH
# is executed
#
# Assuming following file structure:
# .
# |-- myproject
# |-- myproject.git
# set WORKTREE=../myproject
@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,
@sergeylukin
sergeylukin / karabiner.json
Created April 3, 2018 06:03
Karabiner configuration for playing F-117A on OS X
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500
},
"rules": [
{
@sergeylukin
sergeylukin / feed.xml
Created May 6, 2012 13:22
Git hook: Export pushed commit to RSS FEED
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="en">
<title type="text">Git push feed</title>
</feed>
@sergeylukin
sergeylukin / install_face_recognition.sh
Created July 12, 2017 01:59
face recognition ubuntu install
sudo apt-get update
sudo apt-get install build-essential
//sudo apt-get install python3-setuptools
//sudo easy_install3 pip
sudo apt-get install libboost-all-dev
sudo apt-get install python3-dev python3-pip python3-tk python3-lxml python3-six
@sergeylukin
sergeylukin / godoc.sh
Created November 23, 2016 20:29
Run searchable local go lang documentation server
godoc -goroot=/usr/local/go -index -index_files=/tmp/godoc_index.db -write_index
godoc -v -goroot=/usr/local/go -http=:6060 -index -index_files=/tmp/godoc_index.db