Important
|
Use Admonitions
Admonitions
are a better way to do callouts in documentations. Using |
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 Main exposing (..) | |
{-| elm-package install elm-lang/navigation evancz/url-parser | |
-} | |
import Html exposing (Html, caption, div, table, tbody, td, text, th, thead, tr) | |
import Navigation exposing (Location) | |
import String | |
import UrlParser exposing (Parser, (</>), map, oneOf, s, int, string, top, parseHash) |
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
/* vim: set noai ts=4 sw=4: */ | |
:root { | |
-moz-tab-size: 4; | |
tab-size: 4; | |
} | |
code, kbd, pre { | |
font-variant-ligatures: none; | |
} |
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
" vim: noai ts=2 sw=2 | |
set shell=/bin/fish | |
let g:EditorConfig_exec_path = '/bin/editorconfig' | |
if has('mouse') | set mouse=a | endif | |
"set relativenumber | |
set number | |
set scrolloff=4 | |
set inccommand=split |
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
// Open all links on a page in new tab -- for MBW | |
// Requires ECMAScript 6's `Set()` for getting unique urls | |
// I'm too lazy to write a `uniq` function nor do I want to pull in a 3rd party lib | |
// Works in Firefox 25+, Chrome 38+, Opera 25+, Safari 7.1+, Internet Explorer 11+ | |
new Set( | |
Array.prototype.filter.call(document.querySelectorAll('a[href],area[href]'), function(acc, el) { | |
el.href[0] !== '#' && acc.push(el) | |
return acc | |
}, []) | |
).forEach(function(href) { |
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
// renderDeviceDetailsInfo : Device -> React.Node | |
const renderDeviceDetailsInfo = function renderDeviceDetailsInfo(device) { | |
const volCount = availableVolumes.reduce((acc, vol) => | |
acc + 1 + (vol.subdirs ? vol.subdirs.length : 0) | |
, 0); | |
return ( | |
<div className: "device-details-info"> | |
{ | |
[ |
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
(into [:dl] | |
(map #(vector %1 %2) (cycle [:dt :dd]) (flatten (vec (clojure.walk/stringify-keys {:test "me" :foo "bar"}))))) | |
;=> [:dl [:dt "test"] [:dd "me"] [:dt "foo"] [:dd "bar"]] |
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
// Well the string building is pretty dopey with the `+=` append on | |
// a forEach instead of a map, but that slice on the last char sends | |
// shivers of cringe up my spine. | |
_.mixin({ | |
param: function(obj) { | |
var param = ""; | |
_.forEach(obj, function(val, key) { | |
param += key + "=" + val + "&"; | |
}); |
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
/* | |
* Element.matches() | |
* https://developer.mozilla.org/en-US/docs/Web/API/Element/matches | |
* The Element.matches() method returns true if the element would be selected | |
* by the specified selector string; otherwise, returns false. | |
* | |
* Prefixed Support: Android 2.2, Internet Explorer 9, Edge 12, Safari 5.0 | |
* Unprefixed Support: Chrome 34, Firefox 34, Safari 7.1, iOS Safari 8.0 | |
*/ |