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
// Given type definition below | |
interface IQueryType { params: any, result: any } | |
class Query<T extends IQueryType> { | |
run: (params: T['params']) => T['result'] | |
} | |
// If we need to have our DB acquire connection | |
// and then release the after query, it can | |
// then be done in this way | |
const createDbQuery = (dbPool: Pool) => <P, R> ( |
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
Note: Some older devices such as the Galaxy S III did not get the Chromium based browser with | |
the update to Android 4.2 or later. When Samsung later introduced the Galaxy S3 Neo it did get | |
the new browser. | |
Note: With the Android 4.3 release and version 1.5 of the Chromium browser, Samsung did not | |
enable WebAudio API for the Note 3. All other devices did get the WebAudio API. | |
Note: Samsung did not update the browser version with the upgrade from Android 4.3 to 4.4, | |
but did add getUserMedia and WebRTC functionality. |
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
require 'open3' | |
command = "tail" | |
target = "x" * 65535 | |
out = "" | |
Open3.popen3(command) do |stdin, stdout, _| | |
stdin.puts target | |
stdin.close | |
out = stdout.read |
This file has been truncated, but you can view the full file.
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
{ | |
"tree": [ | |
{ | |
"id": "cid73x8k0003x3k5959csf4tn", | |
"type": "Row", | |
"size": 1, | |
"children": [ | |
{ | |
"id": "cid73x8k0003y3k59hgnr1vp1", | |
"type": "Column", |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="viewport" content="width=device-width"/> | |
<title>Modular Template Patterns</title> | |
<!-- | |
This email is an experimental proof-of-concept based on the | |
idea that the most common design patterns seen in email can |
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
class FileSystem { | |
constructor () { | |
this.tree = {} | |
this.binaries = {} | |
} | |
add ({ type, name, path = '/'}) { | |
if (! (type && name)) | |
throw Error('missing required parameters') |
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
{ | |
elType: [ | |
{ type: 10, el: 'h1' }, | |
{ type: 11, el: 'h2' }, | |
{ type: 12, el: 'h3' }, | |
{ type: 13, el: 'h4' }, | |
{ type: 14, el: 'h5' }, | |
{ type: 15, el: 'h6' }, | |
{ type: 2, el: 'p' }, | |
{ type: 3, el: 'a' }, |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
.block { | |
border: 1px solid #666; | |
box-shadow: 2px 2px 2px #333; | |
background: #f1f1f1; |
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
module.exports = function(grunt){ | |
function slug(str){ | |
return str.replace(/\W/g, '-') | |
.replace(/^\W|\W$/g, '') | |
.toLowerCase(); | |
} | |
grunt.initConfig({ |
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 lookup(obj /*Object */, props/* String */){ | |
if ( ! (obj && props)) { return undefined; } | |
var ps = props.split('.'); | |
var pointer = obj; | |
var val = undefined; | |
var i = 0, len = ps.length; | |
for(;i<len;i++) { |
NewerOlder