This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A very basic crude Form class. | |
* It can have input controls + will know their values. | |
* Also will know if it (the form) was itself submitted. | |
*/ | |
class CrudeForm { | |
/** @var string Form name for identifying the form. **/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sine | |
__().sine({id:"kurva"}).lowpass(220).reverb({ | |
seconds: 3, | |
decay: 2, | |
}).dac(0.5); | |
// Loop | |
__.loop({steps:8,interval: 400}); | |
var k =__("#kurva"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prepare some stuff. | |
var bpm = 135; | |
var loopInterval = (60 * 1000) / bpm / 4; | |
// Master channel. | |
__().compressor({id: "master"}).dac(); | |
__().sine({id: "kick", frequency: 60}) | |
.overdrive({drive: 0.05}) | |
.adsr({id: "kickA"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Echo number of GIT commits per year. | |
git log --pretty='format:%cd' --date=format:'%Y' | uniq -c | awk '{print "Year: "$2", commits: "$1}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This script ONLY RETURNS BASH COMMANDS that would take care of the renaming. | |
// Usage: | |
// alembic_filename_date.php --glob=<glob_pattern:*.py> --format=<date_format:Y-m-d_H-i_> | |
$optGlob = '*.py'; | |
$optFormat = 'Y-m-d_H-i_'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lines_as_progress { | |
echo -ne "█ ("$@") " | |
stdbuf --output=L --error=L "$@" 2>&1 | | |
while IFS= read -r line | |
do | |
printf "." | |
done | |
printf " Done" | |
echo | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -f $1 ]]; then | |
cat $1 | while read line | |
do | |
youtube-dl --no-mtime --no-post-overwrites --extract-audio --audio-format mp3 --audio-quality 192K $line | |
done | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docker client inside WSL + Container running under Docker on Windows (tested on Hyper-V's VM) | |
docker run --add-host=localhost:$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1) -it <...containerID...> /bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Number of requests permitted for facebook crawler per second. | |
const FACEBOOK_REQUEST_THROTTLE = 20; | |
const FACEBOOK_REQUESTS_JAR = __DIR__ . '/.fb_requests'; | |
const FACEBOOK_REQUESTS_LOCK = __DIR__ . '/.fb_requests.lock'; | |
$ua = $_SERVER['HTTP_USER_AGENT'] ?? false; | |
if ($ua && strpos($ua, 'facebookexternalhit') !== false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd $(dirname $0) | |
CONF_PATH=~/.ssh/config | |
function title() { | |
echo "█ $1" | |
} |
OlderNewer