{
"build-js": "browserify browser/main.js | uglifyjs -mc > static/bundle.js",
"build-css": "cat static/pages/*.css tabs/*/*.css",
"build": "npm run build-js && npm run build-css",
"watch-js": "watchify browser/main.js -o static/bundle.js -dv",
"watch-css": "catw static/pages/*.css tabs/*/*.css -o static/bundle.css -v",
"watch": "npm run watch-js & npm run watch-css",| import type from 'type-of-is' | |
| export default function parse( input ){ | |
| if( type( input, String ) ){ | |
| return input | |
| } | |
| else if( type( input[ 0 ], Array ) ){ | |
| return input.map( parse ) | |
| } |
Moved to git repository: https://github.com/denji/golang-tls
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)| /***************************************** | |
| /* DOM touch support module | |
| /*****************************************/ | |
| if (!window.CustomEvent) { | |
| window.CustomEvent = function (event, params) { | |
| params = params || { bubbles: false, cancelable: false, detail: undefined }; | |
| var evt = document.createEvent('CustomEvent'); | |
| evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | |
| return evt; | |
| }; |
An interactive version of a Reingold–Tilford tree. Click on the nodes to expand or collapse.
Very minor tweaks were made to create a collapsible tree of a dict-like object.
- The dict is converted to the
flare.jsontree structure with a defaultsize. - I added a subset of a gist API response because that is what I am working on.
- I added lodash because the tree converter was already written.
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
| /** | |
| * Bitmask class | |
| * @param {string[]} values - Array of names of masked properties | |
| */ | |
| function Bitmask (values) { | |
| this.mask = 0; | |
| this.map = values.reduce(function (map, name, idx) { | |
| map[name] = Math.pow(2, idx); | |
| return map; | |
| }, {}); |
At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.
Over the past few months, I have been working on two Haskell services:
- A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
- A new service, which would interact with third-party components using standard data formats from the medical industry.
I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
