Skip to content

Instantly share code, notes, and snippets.

🤘
j-* driven

thoughtsunificator

🤘
j-* driven
View GitHub Profile
@thoughtsunificator
thoughtsunificator / local-storage-aes.js
Last active May 30, 2020
Encrypt and decrypt localStorage item with AES using crypto-js
View local-storage-aes.js
# https://github.com/brix/crypto-js
// encrypt item
const ciphertext = CryptoJS.AES.encrypt(JSON.stringify({ foo: "bar" }), "Secret Passphrase").toString()
// localStorage.setItem("myItem", ciphertext)
// decrypt item
const bytes = CryptoJS.AES.decrypt(localStorage.getItem("myItem"), "Secret Passphrase");
@thoughtsunificator
thoughtsunificator / email-tokenizer.js
Last active May 22, 2020
A modest email tokenizer
View email-tokenizer.js
/*
Copyright (c) 2019, Romain Lebesle <oss@thoughtsunificator.me> (https://thoughtsunificator.me)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
@thoughtsunificator
thoughtsunificator / message-parser.js
Last active May 11, 2020
A tiny library to parse messages
View message-parser.js
/*
Copyright (c) 2019, Romain Lebesle <oss@thoughtsunificator.me> (https://thoughtsunificator.me)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@thoughtsunificator
thoughtsunificator / uri-tokenizer.js
Last active Jun 25, 2020
A small URI tokenizer that I made for a tiny router
View uri-tokenizer.js
/*
Copyright (c) 2019, Romain Lebesle <oss@thoughtsunificator.me> (https://thoughtsunificator.me)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@thoughtsunificator
thoughtsunificator / 01-directory-structure.md
Created Mar 28, 2020 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.
View 01-directory-structure.md

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@thoughtsunificator
thoughtsunificator / README-Template.md
Created Mar 28, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@thoughtsunificator
thoughtsunificator / command-processor.js
Last active May 22, 2020
I needed a simple command processor for domodel-socket-chat that's why I made this small library =)
View command-processor.js
/*
Copyright (c) 2019, Romain Lebesle
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@thoughtsunificator
thoughtsunificator / tweet_tokenizer.js
Last active May 11, 2020
This one is a library that turns tweet-like string into an object that has two arrays: one for mentions and another for hashtags. Useful if you want to linkify mention and/or hashtags =P
View tweet_tokenizer.js
/*
Copyright (c) 2019, Romain Lebesle <oss@thoughtsunificator.me> (https://thoughtsunificator.me)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
You can’t perform that action at this time.