Skip to content

Instantly share code, notes, and snippets.

@corysolovewicz
corysolovewicz / converting_dmg_iso.md
Created August 21, 2019 17:27
Converting DMG to ISO or CDR to ISO on macOS
@raecoo
raecoo / console.save.js
Last active August 7, 2024 21:38
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@Kashkovsky
Kashkovsky / dataToBlob.js
Created June 3, 2016 14:02
Convert data Uri to blob
function dataUrItoBlob(dataUri) {
var binary = atob(dataUri.split(',')[1]);
var mimeString = dataUri.split(',')[0].split(':')[1].split(';')[0];
var array = [];
for (var i = 0; i < binary.length; i++) {
array.push(binary.charCodeAt(i));
}
return new Blob([new Uint8Array(array)], { type: mimeString });
};