// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = pavan.sss1991@gmail.com | |
username = pksunkara | |
[init] | |
defaultBranch = master | |
[core] | |
editor = nvim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
pager = delta |
Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
const connectionString = process.env.MONGO_URI || 'mongodb://localhost/databasenamegoeshere';
- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// see code in action: https://jsfiddle.net/desaroxx/jp4pmd2u/ | |
/* Configuration variables */ | |
var MAX_COLOR = 200; // Max value for a color component | |
var MIN_COLOR = 120; // Min value for a color component | |
var FILL_CHANCE = 0.5; // Chance of a square being filled [0, 1] | |
var SQUARE = 80; // Size of a grid square in pixels | |
var GRID = 5; // Number of squares width and height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flattenTco = ([first, ...rest], accumulator) => | |
(first === undefined) | |
? accumulator | |
: (Array.isArray(first)) | |
? flattenTco([...first, ...rest]) | |
: flattenTco(rest, accumulator.concat(first)) | |
const flatten = (n) => flattenTco(n, []); | |
console.log(flatten([[1,[2,[[3]]]],4,[5,[[[6]]]]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="check mark success animation"> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
/* animations */ | |
@-webkit-keyframes checkmark { |