Skip to content

Instantly share code, notes, and snippets.

View JimCMorrison's full-sized avatar

JimCMorrison

View GitHub Profile
@JimCMorrison
JimCMorrison / Clock.js
Last active October 17, 2017 20:13
A quick React gist of a clock.
function clock(){
const tick = (
<div>
<h1>The Time is:</h1>
<h2>time: {new Date().toLocaleTimeString()}</h2>
</div>
);
ReactDOM.render(
tick,
document.getElementById('root')
@JimCMorrison
JimCMorrison / ro13.js
Created September 15, 2015 01:36
ROT13 decryption implementation in JavaScript
//Created by Jim Morrison, CodingMorrison.com
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
var rot13Alphabet = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm".split("");
var sample = "Lbh qrpelcgrq gur fnzcyr fhpprffshyyl";
var caesar = function(sample) {
var result = "";
for (var x=0; x<sample.length; x++) {
for (var y=0; y<alphabet.length; y++) {
if (sample[x]==alphabet[y]) {
result+=rot13Alphabet[y];