Skip to content

Instantly share code, notes, and snippets.

@josephj
josephj / index.html
Last active July 7, 2020 00:15
Electron show the images by their EXIF thumbnails
<!DOCTYPE html>
<html>
<head>
<title>Thumbnails</title>
</head>
<body>
<div>
<h2>Original</h2>
<img width="100" height="72" id="original" />
</div>
@josephj
josephj / index.html
Last active March 24, 2020 04:48
Electron Keyboard Prototype
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
<style>html, body {background: black; color: #fff}
button {padding: 10px; border-radius: 6px; border: none;}
</style>
</head>
@josephj
josephj / index.html
Created March 24, 2020 03:56
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
<style>html, body {background: black; color: #fff}
button {padding: 10px; border-radius: 6px; border: none;}
</style>
</head>
@josephj
josephj / index.html
Created February 7, 2020 01:01
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>File Listing</title>
</head>
<body>
<h1>File Listing</h1>
<section>
<input
@josephj
josephj / index.html
Created February 7, 2020 00:32
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>File Listing</title>
</head>
<body>
<h1>File Listing</h1>
<section>
<input
@josephj
josephj / index.html
Created February 7, 2020 00:23
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>File Listing</title>
</head>
<body>
<h1>File Listing</h1>
<section>
<input
@josephj
josephj / express-try-catch.js
Last active August 23, 2018 08:19
Error Handling in Express.js
const express = require("express");
const app = express();
const fs = require("fs");
app.get("/", (req, res) => res.send("Hello World!"));
// Express will catch the errors in synchrous code #1
app.get("/error", (req, res) => {
throw new Error("Trigger error #1"); // try-catch is not necessary
});
@josephj
josephj / 0_reuse_code.js
Created September 2, 2017 21:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@josephj
josephj / initial-state.json
Last active April 19, 2016 12:14
Redux Store Proposal for Stackla
{
"app": {
"stack": "fixtures"
},
"reports/index": {
"data": {
"reports": []
},
"didInvalidate": false,
"isFetching": false,
'use strict';
/**
* <CodeMirror
* mode="text/css"
* value={that.state.customCss}
* onChange={that.handleEditorChange}/>
*/
// CodeMirror modules