Skip to content

Instantly share code, notes, and snippets.

@johnoscott
johnoscott / sparkline.md
Last active November 15, 2018 08:08
Hide Sparkline end value
@johnoscott
johnoscott / out.log
Created November 12, 2018 23:57
Create a Self-signed Certificate for Development
Credit to : https://github.com/kingkool68/generate-ssl-certs-for-local-development
Here is the sample output after running the script:
sudo ./generate-ssl.sh local.dev
Password:
Generating RSA private key, 2048 bit long modulus
..........+++
..............................................+++
<iframe src="data:text/html;charset=utf-8,%3Cbody%3E%3Cscript%20src%3D%22https%3A%2F%2Fgist.github.com%2Fef4%2Ffe2e8e5b6e75266e3c2d.js%22%3E%3C%2Fscript%3E%3C%2Fbody%3E">
@johnoscott
johnoscott / react-data-grids.md
Last active April 18, 2018 03:19
[React Data Grid Examples] Some research on the better data grids for React #datagrid #react

React Data Grid Examples

Edit new

<iframe src="https://codesandbox.io/embed/new" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe> Edit new
@johnoscott
johnoscott / rotate_pi.sh
Created April 16, 2018 02:18
[Rotate Raspberry Pi Display from Terminal] #raspberry-pi
INSTALLATION
We've created a one-liner that automates the installation procedure. To get started with this display, simply execute curl -L http://coreelec.io/2q | bash
If you want to see what this script does before running, save it to a file with curl -L http://coreelec.io/2q >> lcd35-installer
You can roll back to using the regular HDMI output at any time by executing the included LCD_hdmi script.
https://core-electronics.com.au/3-5inch-display-module-touch-lcd-with-stylus-for-raspberry-pi-3.html
To rotate your display, simply enter display_rotate or lcd_rotate at the bottom of your config file:
@johnoscott
johnoscott / generateUUID.js
Created April 6, 2018 02:14
[Generat UUID] Create a UUID with JavaScript
function generateUUID() { // Public Domain/MIT
var d = new Date().getTime();
if (typeof performance !== 'undefined' && typeof performance.now === 'function'){
d += performance.now(); //use high-precision timer if available
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
@johnoscott
johnoscott / docker_cloud_stack_on_digital_ocean_for_$5_per_mo.md
Last active April 1, 2018 03:21
[Docker Cloud Stack on Digital Ocean $5 per mo]

Dockerize a React App in 2018 with CreateReactApp

TLDR

Markdown Less Pretty
Still renders nicely
1 2 3

References

Dockerize a React App in 2018 with CreateReactApp

TLDR

Markdown Less Pretty
Still renders nicely
1 2 3

References

@johnoscott
johnoscott / index.html
Last active March 31, 2018 01:47
[Matrix Rotation] Javascript implementation of 90degree clockwise rotation of nxn matrix
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<!--<link rel="stylesheet" href="styles.css">-->
</head>
<body>
<h1>Hello world!</h1>
<script src="rotate-matrix.js"></script>
@johnoscott
johnoscott / markdown_cheats.md
Last active March 31, 2018 01:32
[Markdown HowTo] Cheats for Markdown syntax