^data:((?:\w+\/(?:(?!;).)+)?)((?:;[\w\W]*?[^;])*),(.+)$
test this pattern on regexr: https://regexr.com/4inht
regex pattern to match RFC 2397 data URL
^data:((?:\w+\/(?:(?!;).)+)?)((?:;[\w\W]*?[^;])*),(.+)$
test this pattern on regexr: https://regexr.com/4inht
regex pattern to match RFC 2397 data URL
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"sync" | |
) |
References:
To compute the results, just use Melody and run the script:
melody run https://gist.github.com/Pierstoval/ed387a09d4a5e76108e60e8a7585ac2d
# download release from github: https://github.com/monostream/tifig/releases and install at ~/tools/tifig | |
# then run these commands in the folder (just to keep things simple we normalize the file extension case before proceeding). | |
for f in *.HEIC; do mv "$f" "`echo $f | sed s/.HEIC/.heic/`"; done | |
for file in *.heic; do echo "~/tools/tifig -v -p $file ${file/%.heic/.jpg}"; done |
git diff-tree --no-commit-id --name-only -r HEAD | xargs subl |
#Import a directory of text files as google keep notes. | |
#Text Filename is used for the title of the note. | |
import gkeepapi, os | |
username = '[email protected]' | |
password = 'your app password' | |
keep = gkeepapi.Keep() | |
success = keep.login(username,password) |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class CorsMiddleware | |
{ | |
/** | |
* Handle an incoming request. |
We want to upload file to a server with POST HTTP request. We will use curl functions.
// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");
// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");