Skip to content

Instantly share code, notes, and snippets.

View skillaug's full-sized avatar
💭
Improving Alchemist Restful API (nvmcommunity/alchemist-restful-api)

Luu Thanh Sang skillaug

💭
Improving Alchemist Restful API (nvmcommunity/alchemist-restful-api)
View GitHub Profile
@skillaug
skillaug / kcdo
Created February 17, 2022 09:20 — forked from mnadel/kcdo
Exec Across (Some, All) Pods in Kubernetes
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage {
echo "usage: $PROGNAME [-n NAMESPACE] [-m MAX-PODS] -s SERVICE -- COMMAND"
echo " -s SERVICE K8s service, i.e. a pod selector (required)"
echo " COMMAND Command to execute on the pods"
echo " -n NAMESPACE K8s namespace (optional)"
echo " -m MAX-PODS Max number of pods to run on (optional; default=all)"
@skillaug
skillaug / docker-cleanup-unused-resources.md
Last active December 12, 2020 10:26 — forked from bastman/docker-cleanup-resources.md
Docker Stack - cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes [https://github.com/chadoe/docker-cleanup-volumes]

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm

delete networks

@skillaug
skillaug / xampp-php-xdebug.md
Last active December 12, 2020 10:39 — forked from odan/xampp_php7_xdebug.md
PHP Stack - Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

SHOW ENGINE INNODB STATUS;
SHOW VARIABLES LIKE "%version%";
SHOW FULL PROCESSLIST
SHOW GLOBAL STATUS LIKE '%Threads_connected%';
SHOW GLOBAL STATUS LIKE '%Threads_running%';
@skillaug
skillaug / ffmpeg
Created September 16, 2018 09:03
ffmpeg mp4 to stream m3u8
.\ffmpeg.exe -i D:\Xampp\htdocs\lyrics_frontend\public\demo-1232.mp4 -co
dec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls D:\Xampp\htdocs\lyrics_frontend\public\demo-1232\playlist
.m3u8
@skillaug
skillaug / whoops.php
Created August 17, 2018 08:19
php error handling for cool kids
composer require filp/whoops
API Documentation : https://github.com/filp/whoops/blob/HEAD/docs/API%20Documentation.md
Available Handlers
whoops currently ships with the following built-in handlers, available in the Whoops\Handler namespace:
PrettyPageHandler - Shows a pretty error page when something goes pants-up
var addEvent = (function () {
var filter = function(el, type, fn) {
for ( var i = 0, len = el.length; i < len; i++ ) {
addEvent(el[i], type, fn);
}
};
if ( document.addEventListener ) {
return function (el, type, fn) {
if ( el && el.nodeName || el === window ) {
el.addEventListener(type, fn, false);
@skillaug
skillaug / zeller.js
Last active January 18, 2019 09:43
Implement công thức Zeller (tìm weekday)
// hàm tính thế kỷ
function century(y) {
return Math.floor(y / 100);
}
// hàm tính tháng cho công thức zeller
function month(m) {
if (m < 3) return m + 10;
else return m - 2;
}
@skillaug
skillaug / git.sh
Last active October 12, 2018 04:20
#init git
git init
git remote add origin https://xxx.git
git fetch
git checkout -b master
git add * && git commit -m "" (Edit, add and commit your files.)
git push -u origin master