- Line by line
- No colors
- Able to be piped into vim (shown later on)
diff <(curl -vs https://reddit.com 2>&1) <(curl -vs https://reddit.com 2>&1)
// Map from lowercase to flag emoji | |
const mapLowerUpper = { | |
'a': '🇦', 'b': '🇧', 'c': '🇨', 'd': '🇩', 'e': '🇪', | |
'f': '🇫', 'g': '🇬', 'h': '🇭', 'i': '🇮', 'j': '🇯', | |
'k': '🇰', 'l': '🇱', 'm': '🇲', 'n': '🇳', 'o': '🇴', | |
'p': '🇵', 'q': '🇶', 'r': '🇷', 's': '🇸', 't': '🇹', | |
'u': '🇺', 'v': '🇻', 'w': '🇼', 'x': '🇽', 'y': '🇾', 'z': '🇿' | |
}; | |
// Map for Morse code |
// UTF8 Module | |
// | |
// Cleaner and modularized utf-8 encoding and decoding library for javascript. | |
// | |
// copyright: MIT | |
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com | |
(function (name, definition, context, dependencies) { | |
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); } | |
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); } | |
else { context[name] = definition.apply(context); } |
Document for the best design choices you can make for your software.
Terminology
components
containing all component files.File Structure
Structuring applications is hard, here are a few resources to help.
/* | |
* CSS & CSS3 Notepad | |
* | |
* These were made for my personal usage, as I constantly use them. | |
* I have decided to open-source the file. | |
* | |
* Some is very useful, other things may be re-dundant. | |
* | |
* Once again, these are simply my css notes. | |
* |
So, I was developing a node shell script and wanted to determine the time it took from start, to finish to generate the output of a file. Simple, right? It is, but the problem is that if you want a clean way to do it... you have to develop it, otherwise you'll have a lot of wrapper code surrounding methods and such. So I wrote a small method to simplify it even further.
Benchmark Method:
function benchmark (method) {
var start = +(new Date);
method && method(function (callback) {
var end = +(new Date);
{ | |
"description": "caps_lock + w,a,s,d to arrow_keys", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "w", | |
"modifiers": { | |
"mandatory": [ | |
"fn" | |
], |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
/* | |
* Javascript Annotations | |
* | |
* Maybe I am ahead of my time, or behind the times (asm.js). | |
* Either way, this is how they work (or could work) if you aren't afraid of some simple RegExp magic. | |
* | |
* @author Nijiko Yonskai | |
* @license MIT (or whatever college/license/name you prefer ;) | |
* @copyright 2013 | |
*/ |
//=========================================================================== | |
// Extend DataManager to persist specific changes | |
//=========================================================================== | |
const RMMZ_DataManager_makeSaveContents = DataManager.makeSaveContents; | |
const RMMZ_DataManager_extractSaveContents = DataManager.extractSaveContents; | |
const RMMZ_DataManager_onLoad = DataManager.onLoad; | |
DataManager.makeSaveContents = function() { | |
const contents = RMMZ_DataManager_makeSaveContents.call(this); |