Skip to content

Instantly share code, notes, and snippets.

View 77Z's full-sized avatar
😮

Vincent Richter 77Z

😮
View GitHub Profile
function getLineBreakChar(string) {
const indexOfLF = string.indexOf('\n', 1); // No need to check first-character
if (indexOfLF === -1) {
if (string.indexOf('\r') !== -1) return '\r';
return '\n';
}
if (string[indexOfLF - 1] === '\r') return '\r\n';
return '\n';
}
@77Z
77Z / index.html
Created August 17, 2019 17:19
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<input type="text" id="text" />
<button id="btn">
Save!
@77Z
77Z / json.json
Last active August 6, 2019 04:02
RANDOM JSON FILE!
{
"version": "1.0.8"
}
++[---------->+<]>.---------.+.-[----->+<]>++++.[--->++<]>---.---------.---.-----[->++<]>.[--->++<]>---.+++++++.[----->+<]>+.-[-->+++<]>+.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.---------.+.-[----->+<]>+++.[----->+<]>++.---------.+.-[-->+++<]>+.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.+++++++.[---->+++<]>++.-----[->++<]>.[--->++<]>---.---------.---.[--->+<]>----.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.---------.+.-[----->+<]>+++.[----->+<]>++.---------.---.[--->+<]>----.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.+++++++.[---->+++<]>++.-----[->++<]>.[--->++<]>---.---------.+.-[-->+++<]>+.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.---------.---.[------->+<]>.[----->+<]>++.+++++++.[---->+++<]>++.[--->+<]>----.+[---->+++<]>-.---------.---.-----[->++<]>.[--->++<]>---.---------.+.-[----->+<]>++++.[--->++<]>---.+++++++.[---->+++<]>++.[--->+<]>----.+[---->+++<]>-.---------.+.-[----->+<]>++++.[--->++<]>---.---------.---.[------->+<]>.[-
@77Z
77Z / main.js
Created March 29, 2019 22:27
electron main.js template
const {app, BrowserWindow} = require('electron');
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600})
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)