Skip to content

Instantly share code, notes, and snippets.

View abiusx's full-sized avatar

AbiusX abiusx

View GitHub Profile
hs.hotkey.bind({}, "§", function() hs.eventtap.keyStroke({}, "`") end )
hs.hotkey.bind({ "cmd" }, "§", function() hs.eventtap.keyStroke({ "cmd" }, "`") end )
hs.hotkey.bind({ "shift" }, "§", function() hs.eventtap.keyStroke({ "shift" }, "`") end )
hs.hotkey.bind({ "cmd", "shift" }, "§", function() hs.eventtap.keyStroke({ "cmd", "shift" }, "`") end )
@abiusx
abiusx / youtube-updater.php
Created December 10, 2018 21:57
Youtube Video Updater in Pure PHP
<?php
/**
* This script can be used to modify videos on Youtube programatically.
* It does not need Google API libraries, it merely uses PHP's CURL.
*
* Before starting to work with this, read the comments below for oAuth_token()
* function. It requires you do 3 steps (twice run this code while uncommenting,
* once login on your browser). Once you have done that and updated the constants
* below, you're good to go!
@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@abiusx
abiusx / stdlib.php
Last active April 17, 2017 05:10
Standard PHP Library
<?php
function grep_r($str,$find)
{
return substr($str,$r=strpos($str,$find)+strlen($find),strpos($str,PHP_EOL,$r)-1-$r);
}
function curl($url,$postparams=[],$headers=[],$additional_opts=[])
{
$opts=[
CURLOPT_COOKIEJAR => 'stdlib.cookie',
CURLOPT_COOKIEFILE => 'stdlib.cookie',
@rkuzsma
rkuzsma / docker-bash-completion.md
Last active November 18, 2023 09:11
How to configure Bash Completion on Mac for Docker and Docker-Compose

How to configure Bash Completion on Mac for Docker and Docker-Compose

Copied from the official Docker-for-mac documentation (thanks Brett for the updated doc pointer):

Install shell completion

Docker Desktop for Mac comes with scripts to enable completion for the docker, docker-machine, and docker-compose commands. The completion scripts may be found inside Docker.app, in the Contents/Resources/etc/ directory and can be installed both in Bash and Zsh.

Bash

Bash has built-in support for completion To activate completion for Docker commands, these files need to be copied or symlinked to your bash_completion.d/ directory. For example, if you installed bash via Homebrew:

@vvo
vvo / video-snapshots-sprites.sh
Created July 15, 2013 14:28
generate sprites of video snapshots
sudo aptitude install ffmpeg
sudo aptitude install imagemagick
# fps=1 > every seconds
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png
# horizontal sprite, resized at 30%
convert -resize 30% +append out*.png sprite-1-sec.png
# references: