$ uname -r
This file contains 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 | |
# | |
# usage: bash mozjpeg.sh directory | |
# | |
find "$1" -type f -name '*.jpg' -print0 | while read -d $'\0' file | |
do | |
echo ${file} | |
mkdir -p opt/"$(dirname "$file")" | |
djpeg $file | cjpeg -quality 80 | jpegtran -optimize -progressive > opt/$file | |
done |
This file contains 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
▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ | |
▕ TEST ▕ | |
▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ |
This file contains 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 | |
$data = "123456"; | |
$key = "17839778773fadde0066e4578710928988398877bb123789"; | |
$options = 0; | |
$key = pack("H*", $key); | |
foreach (openssl_get_cipher_methods() as $method) | |
{ | |
$enc = @openssl_encrypt($data, $method, $key, $options); |
This file contains 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 is for schema http://www.sitemaps.org/schemas/sitemap/0.9 | |
// config | |
$lastNElements = 20; | |
// url or filepath | |
//$source = 'https://www.digitec.ch/sitemap0.xml'; |
This file contains 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 | |
// debug script | |
// apiDoc: https://devdocs.magento.com/guides/m1x/api/soap/checkout/checkout.html | |
$proxy = new SoapClient('http://lts.localhost/api/v2_soap/?wsdl'); | |
$sessionId = $proxy->login('debug', 'debug123'); | |
// create cart |
This file contains 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 | |
header("Content-type: text/plain"); | |
echo "array(\n"; | |
foreach (new NoRewindIterator(new SplFileObject('https://data.iana.org/TLD/tlds-alpha-by-domain.txt')) as $i => $v) { | |
if ($i == 0) {continue;}; | |
echo "\040\040\040\040'".idn_to_utf8(trim(strtolower($v)))."',\n"; | |
} | |
echo ");"; |
This file contains 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
https://www.netflix.com/browse/genre/<GENRE-CODE>/ | |
Action & Adventure (1365) | |
Asian Action Movies (77232) | |
Classic Action & Adventure (46576) | |
Action Comedies (43040) | |
Action Thrillers (43048) | |
Adventures (7442) | |
Comic Book and Superhero Movies (10118) | |
Westerns (7700) |
This file contains 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 | |
function return_bytes($val) { | |
$val = trim($val); | |
$last = strtolower($val[strlen($val)-1]); | |
switch($last) { | |
// The 'G' modifier is available since PHP 5.1.0 | |
case 'g': | |
$val *= 1024; | |
case 'm': |
This file contains 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 | |
/** | |
* convert magento translation file to ios STRING file | |
* to use the google translation toolkit | |
* | |
* usage: php convert.php translation.csv > translation.STRINGS | |
* php convert.php translation.STRINGS > translation.csv | |
* | |
* @author rcro <[email protected]> | |
*/ |
NewerOlder