Skip to content

Instantly share code, notes, and snippets.

I think you should tranfer image in base64 to image with blob, because when you use base64 image, it take a lot of log lines or a lot of line will send to server. With blob, it only the file. You can use this code bellow:
dataURLtoBlob = (dataURL) ->
# Decode the dataURL
binary = atob(dataURL.split(',')[1])
# Create 8-bit unsigned array
array = []
i = 0
while i < binary.length
array.push binary.charCodeAt(i)
@Dzinlife
Dzinlife / gist:29ba6265842a7dc02f5919fdae3e884e
Created December 7, 2017 10:02
use ImageMagick to generate semi-transparent favicon.ico
convert transparent-img1.png transparent-img2.png transparent-img3.png -channel Alpha favicon.ico
const params = {}
query.replace(/([^=?#&]*)=([^?#&]*)/g, function(e, $1, $2) {
params[decodeURIComponent($1)] = decodeURIComponent($2)
})
@Dzinlife
Dzinlife / *.js
Last active March 12, 2020 17:58
Surge Script - Jellow Display User Followed Status
//URL regexp
\/\/api\.jellow\.club\/1\.0\/users\/profile
if (!follewedList) {
var follewedList = new Set()
}
(($request, $response, $done) => {
const JELLOW_ID = 'YOUR_JELLOW_ID'
const requestUrl = $request.url