Big overview of what's missing in Safari 7.1+ and iOS 8+ in terms of browser storage.
Updated May 25th 2016
// Run on https://start.1password.com to get sjcl | |
function timeSJCL_SHA256(iterations, value) { | |
let timerName = "SJCL SHA-256 (" + value.length + " bytes, " + iterations + " iterations)"; | |
console.time(timerName); | |
for (let i = 0; i < iterations; i++) { | |
sjcl.hash.sha256.hash(value); | |
} | |
console.timeEnd(timerName); |
const arr1 = [1,2,3] | |
const arr2 = [4,5,6] | |
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6] |
var request = require('request'); | |
var unzip = require('unzip'); | |
var csv2 = require('csv2'); | |
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip') | |
.pipe(unzip.Parse()) | |
.on('entry', function (entry) { | |
entry.pipe(csv2()).on('data', console.log); | |
}) | |
; |
@Entity | |
public class Parent implements Serializable { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true) | |
private Set<Child> children = new HashSet<>(); | |
... |
This document assumes you are building a traditional backend-heavy application as opposed to a frontend-heavy appliction which would typically use a framework like Angular or React. The use of these frameworks make this document irrelevant, however also require a change to your application architecture and a much larger overhead in order to get content onto a page, so as a simple way to build interactive web content a simple jquery based js stack will do fine.
It's important you use a directory structure which is impartial to your development environment, chosen server language (Python v. Java v. C# ...), and styling framwork (Twitter Bootstrap etc). This layer of separation means you can swap out the styles or the backend with minimal changes to the Js, simple and maintainable.
Here's an example from the project root:
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
Create DOM Elements | Conditionals |