Skip to content

Instantly share code, notes, and snippets.

View harlantwood's full-sized avatar
💭
☀️

Harlan T Wood harlantwood

💭
☀️
View GitHub Profile
# install rust + cargo
curl https://sh.rustup.rs -sSf | sh
brew install emscripten
cargo install cargo-web
git clone https://github.com/DenisKolodin/yew.git
cd yew/examples/todomvc
cargo web build --target=wasm32-unknown-emscripten
@harlantwood
harlantwood / proof.md
Created February 22, 2017 04:34
Proof of existence

Nodes/Branch-Compare-Integrate-Short

Git Branches:

  • 8f072f3de442b734e7b1cfae65db62ecadcea31d

Nodes/Branch-Compare-Integrate-in-the-Creative-Commons

Git Branches:

@harlantwood
harlantwood / mongodbcheats.js
Created November 25, 2016 23:45 — forked from kgorman/mongodbcheats.js
MongoDB cheat sheet
/* MongoDB cheat sheet */
// replication lag via serverStatus()
db._adminCommand( { serverStatus : 1 , repl : 2 } )
// stats
db.stats()
db.foo.stats()
// size of BSON of some query
@harlantwood
harlantwood / ipfs-add-file.js
Last active July 18, 2021 08:09
Upload a binary file to IPFS via React.
// This is DEPRECATED, see a full running example here instead:
// https://github.com/ipfs/js-ipfs-api/tree/97f6ed27d72b189c02865cb0fdd4f58fafd89625/examples/upload-file-via-browser
import React from 'react'
import IpfsApi from 'ipfs-api'
const Buffer = require('buffer/').Buffer
export default class AddMedia extends React.Component {
constructor {

Keybase proof

I hereby claim:

  • I am harlantwood on github.
  • I am harlan (https://keybase.io/harlan) on keybase.
  • I have a public key whose fingerprint is B104 2E70 8F5F C6B3 E9CA 361B 0AD4 31E7 05D6 E6F6

To claim this, I am signing this object:

<?php
function order_items_include_tracking_pixel($order) {
foreach ( $order->get_items() as $item ) {
$product = $order->get_product_from_item( $item );
if ( ! $product ) { continue; }
$sku = $product->get_sku();
if (preg_match('/-tp$/', $sku) === 1) {
return true;
}

This is a demo of (some of the features of) the Node.js library lightsaber.

Simply run:

npm install lightsaber
./generate_docs.coffee > generated_docs.md

To rebuild generated_docs.md from the coffeescript source.

{
"detect_indentation": false,
"font_size": 19.0,
"indent_to_bracket": true,
"save_on_focus_lost": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
@harlantwood
harlantwood / Adding NewRelic to a NodeJS Heroku app.md
Last active August 29, 2015 14:07
Adding NewRelic to a Node.js Heroku app
heroku addons:add newrelic
npm install newrelic --save
cp node_modules/newrelic/newrelic.js .

get the New Relic license key:

heroku config:get NEW_RELIC_LICENSE_KEY

edit newrelic.js, editing app name and license key. Optionally change logging level:

000c27fd7e4f4ecb25cb4084da3ba59bb1c464bb
001f3a462c8b64282add20d3d5b251a3f3a4adee
00304f1e0f2e7a222996f361c21c82674aa693cb
003f92f49c0900f0cc65a6c849464265f42cbdf4
003fe879644868a473ceda0afb884d925a0c3c4c
00716bb5e88ffc67a27003c8491efe19f60293e9
0076da8939010a29e76fee02f55d1ca2c463eb89
00837dfbb3bb516dba49b497442e144cfcc9234c
0095eed98773c90d74db38cf8ab34b696f243b46
00b3283293cf13ca013a494e350172ab4e447b19