NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
<?php | |
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
// Start a session (which should use cookies over HTTP only). | |
session_start(); | |
// Create a new CSRF token. | |
if (! isset($_SESSION['csrf_token'])) { | |
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
} |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
# PBP .perltidyrc file | |
# Uncomment #-st to fully emulate perltidy -pbp | |
-l=78 # Max line width is 78 cols | |
-i=4 # Indent level is 4 cols | |
-ci=4 # Continuation indent is 4 cols | |
#-st # Output to STDOUT | |
-b # Write the file inline and create a .bak file | |
-se # Errors to STDERR |
# vi: ft=dosini | |
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
github = pksunkara | |
[core] | |
editor = nvim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
pager = delta | |
[column] |
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
// assignment in function parameters | |
function sum1 ({Array: numbers}) { | |
let total = 0; // let {Number: total} = 0; would also be fine | |
let i = numbers.length; | |
while (i--) { | |
let {Number: n} = numbers[i]; | |
total += n; | |
} | |