brew install zsh
echo $(which zsh) | sudo tee -a /etc/shells
sudo chsh -s $(which zsh) $USER
#!/bin/sh | |
for f in *.m4a; do ffmpeg -i "$f" -c:a flac "${f%.m4a}.flac"; done |
#!/bin/sh | |
cdparanoia -Q 2>&1 | | |
grep "^ *[1-9]" | | |
sed -e 's/^ *\|\..*//g' | | |
while read t; do | |
cdparanoia $t - | ffmpeg -i pipe: -c:a 128k -ar 44100 -ac 2 -y "rip $t.mp3"; | |
done |
{ | |
/tool fetch url=https://curl.haxx.se/ca/cacert.pem | |
/certificate import file-name=cacert.pem passphrase=”” | |
/ip firewall layer7-protocol | |
add name=security.cloudflare-dns.com regexp=security.cloudflare-dns.com | |
/ip dns | |
set allow-remote-requests=yes cache-max-ttl=1h servers=1.1.1.2,1.0.0.2,2606:4700:4700::1112,2606:4700:4700::1002 use-doh-server=https://security.cloudflare-dns.com/dns-query verify-doh-cert=yes | |
/ip firewall filter | |
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=tcp | |
add action=drop chain=output comment="drop dns output if not looking for cloudflare DOH servers." dst-port=53 layer7-protocol=!security.cloudflare-dns.com out-interface-list=WAN protocol=udp |
<?php | |
/** | |
* Redirect posts within a date range to new URL with wp_redirect() | |
* @url https://paulund.co.uk/get-posts-between-certain-dates-wordpress-rest-api | |
*/ | |
add_action( 'template_redirect', function() { | |
$args = array( | |
'date_query' => array( | |
array( | |
'after' => 'November 1, 2020', |
<?php | |
/** | |
* Functions | |
* | |
* @package Facebook Conversions API | |
* @since 1.0 | |
* @link https://rotsenacob.com/ | |
* @author Rotsen Mark Acob <rotsenacob.com> | |
* @copyright Copyright (c) 2020, Rotsen Mark Acob | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
<?php | |
// Validate Phone Numbers for US | |
function validate_phone( $phone ) { | |
return preg_match( "/^\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$/i", $phone ); // @link https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s02.html | |
} | |
add_filter( 'wpcf7_validate_tel', 'tc_validate_tel', 20, 2 ); | |
add_filter( 'wpcf7_validate_tel*', 'tc_validate_tel', 20, 2 ); | |
function tc_validate_tel( $result, $tag ) { |
<?php | |
/** | |
* Functions | |
* | |
* @package Twenty Twenty Child | |
* @since 1.0 | |
* @link https://rotsenacob.com | |
* @author Rotsen Mark Acob <rotsenacob.com> | |
* @copyright Copyright (c) 2020, Rotsen Mark Acob | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
// modifys contact form 7's default select value of --- to Please select... | |
function my_wpcf7_form_elements($html) { | |
$text = 'Please select...'; | |
$html = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $html); | |
return $html; | |
} | |
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements'); | |
// Modify multiple selects | |
function my_wpcf7_form_elements($html) { |
Dear all Github friends,
I moved this gist to the Github repository.
Following this repository https://github.com/nijicha/install_nodejs_and_yarn_homebrew