Skip to content

Instantly share code, notes, and snippets.

View mhkeller's full-sized avatar

Michael Keller mhkeller

View GitHub Profile
@mhkeller
mhkeller / search-all.sql
Created January 23, 2018 16:49
Convert each row in a postgresql table to a text search vector to search across all fields in a table
select *
from table_name
where to_tsvector(table_name::text) @@ to_tsquery('full-text-query');
var fs = require('fs')
var codeBlockOne = fs.readFileSync('code-block-1.txt', 'utf-8')
var codeBlockTwo = fs.readFileSync('code-block-2.txt', 'utf-8')
var blocks = [codeBlockOne, codeBlockTwo]
blocks.forEach((block, i) => {
fs.writeFileSync('highlighted-block-' + i + '.txt', highlight(block))
})
// sass-watch.js
var watcher = require('wsk').watcher;
var watchGroup = {
serviceName: 'sass',
path: 'src/css/*.scss',
events: [
{
type: 'change',

test arrow ⇒

@mhkeller
mhkeller / index.html
Created December 1, 2017 21:04
Responsive D3 chart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000;
stroke-width: 10px;
}
@mhkeller
mhkeller / index.html
Last active March 17, 2022 04:05
Responsive d3 line chart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000;
stroke-width: 10px;
}
@mhkeller
mhkeller / index.html
Created December 1, 2017 00:28
Basic D3 Line Chart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000;
stroke-width: 10px;
}

Double open: “

Double close: ”

Single open: ‘

Single close: ’

@mhkeller
mhkeller / index.html
Created May 24, 2017 00:54
broken dbf
<body>
<script src="https://wzrd.in/standalone/buffer"></script>
<script src="https://unpkg.com/dbf@latest/dbf.js"></script>
<script src="index.js"></script>
<h2 style="font-family:Helvetica;">Click this to download a broken dbf</h2>
<button onclick="downloadDbf()">download</button>