I hereby claim:
- I am danielfgray on github.
- I am danielfgray (https://keybase.io/danielfgray) on keybase.
- I have a public key ASCGfXdCDEBGUKknNv9tGvObZXRnhwelTsPy_7dQGr5K-Ao
To claim this, I am signing this object:
| 'use strict'; | |
| function validISBN10(isbn) { | |
| if(! /\d{9}[X0-9]/.test(isbn)) return false; | |
| return isbn.split('').reduce((p, c, i) => { | |
| return p + ((c == 'X') ? 10 : parseInt(c)) * ++i; | |
| }, 0) % 11 == 0; | |
| } | |
| (function (func, cases, invert) { |
| #!/usr/bin/env bash | |
| # DanielFGray 2016 | |
| # https://gist.github.com/d47925487840bb445296 | |
| err() { | |
| local c_red="${esc}[31m" | |
| echo -e "${c_red}$1${c_reset}" >&2 | |
| } |
| #!/usr/bin/env node | |
| 'use strict'; | |
| // http://www.codewars.com/kata/53db4acb1f1a7dd68700040a/train/javascript | |
| function canReach(from, to, movements) { | |
| //FIXME: attempt in multiple moves | |
| const offset = [ Math.abs(from[0] - to[0]), Math.abs(from[1] - to[1]) ]; | |
| const valid_offsets = [ [1, 2], [2, 1] ]; | |
| return valid_offsets.some(o => { |
| " If you want to test this, save it somewhere, open in vim, `:so %`. | |
| " Slowly type <leader>g andand g-commands should happen in the other buffer. | |
| " In the demo webm above, I just slowly typed `<leader>gJ` | |
| " I only added descriptions for a few commands but others should work | |
| " Needs massive re-working to actually be maintainable | |
| " WHY: | |
| " Vim is an amazing tool, but one of it's few weaknesses is discoverability. | |
| " While it's great to have a tool that you can continually learn new things about, | |
| " learning those things would ideally happen sooner than later. Spacemacs ships with "which-key" |
| module.exports = { | |
| files: { | |
| javascripts: { | |
| joinTo: { | |
| 'vendor.js': /^(?!app)/, | |
| 'app.js': /^app/ | |
| } | |
| }, | |
| stylesheets: {joinTo: 'app.css'} | |
| }, |
| #!/usr/bin/env bash | |
| declare activeWorkspace="*%s" | |
| declare inactiveWorkspace=" %s" | |
| declare separator=" │ " | |
| xprop -spy -root | | |
| awk -v inactiveWorkspace="$inactiveWorkspace" \ | |
| -v activeWorkspace="$activeWorkspace" \ | |
| -v separator="$separator" -F' = ' ' |
I hereby claim:
To claim this, I am signing this object:
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>scratchpad</title> | |
| <meta charset="UTF-8"/> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
| <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" media="all" /> | |
| <link type="text/css" rel="stylesheet" href="style.css" media="all" /> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
| <script src="marked.min.js"></script> |
| /* eslint-disable import/no-extraneous-dependencies */ | |
| const path = require('path') | |
| const webpack = require('webpack') | |
| const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
| const HtmlWebpackPlugin = require('html-webpack-plugin') | |
| const babelOpts = { | |
| test: /\.jsx?$/, | |
| exclude: /node_modules/, | |
| use: [ |