Skip to content

Instantly share code, notes, and snippets.

matrix = {
digit: 1,
row: 3,
column: 4,
arrays: {
cellAray: [0,0,0,1],
rowArray: [0,0,1,0],
columnArray: [0,0,0,1],
blockArray: [0,0,0,1]
}
@adampash
adampash / Makefile
Created December 9, 2013 20:44
Trying to get a Makefile working with NaCl OpenCV port
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# GNU Makefile based on shared rules provided by the Native Client SDK.
# See README.Makefiles for more details.
VALID_TOOLCHAINS := newlib glibc pnacl
NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../..)
@adampash
adampash / Makefile
Created December 9, 2013 23:05
A simpler Makefile
INCLUDES=-I$(NACL_SDK_ROOT)/include -L$(NACL_SDK_ROOT)/lib/pnacl/Release \
-I$(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/i686-nacl/usr/include
LIBS:= -lppapi_cpp -lppapi \
-lpthread \
-lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect \
-lpng -ltiff -ljpeg -lzlib
all:
$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-clang++ hello_tutorial.cc \
@adampash
adampash / gist:7913599
Created December 11, 2013 16:26
Bash/ZSH function for copying a file to the clipboard
copy () {
cat "$@" | pbcopy;
}

Keybase proof

I hereby claim:

  • I am adampash on github.
  • I am adampash (https://keybase.io/adampash) on keybase.
  • I have a public key whose fingerprint is 4430 3B96 6A02 59AE FD36 BA7F 5066 A3C3 2EA3 6D5F

To claim this, I am signing this object:

@adampash
adampash / insights_subjects.md
Last active August 29, 2015 14:05
Working doc for ThinkUp subject lines

In order to transition to the new subject lines, we'll need to rewrite the body of several of the insights. I've highlighted the needs for each insight, below, but it shakes down to:

Minor rewrite No rewrite
19 15

Activity Spike (activityspike.php):

  • Post activity spikes for the past 7, 30, and 365 days.
    • 30-day: MED
  • 365-day: HIGH

One-liner

Describe what this insight is in a single sentence. This is the description that appears in ThinkUp's insights list, so phrase it like the others are. Current insights single sentences are:

  • Post activity spikes for the past 7, 30, and 365 days.
  • How often you referred to yourself ("I", "me", "myself", "my") in the past week.
  • How many more users a message has reached due to your reshare or retweet.

Full explainer

@adampash
adampash / gist:474cd07349a675177bdf
Last active August 29, 2015 14:16
JSONP request to kinja GET post api
$ = require 'jquery'
module.exports = PostGetter =
api: "http://kinja.com/api/core/post"
isLink: (link) ->
@newLink(link) or @oldLink(link)
newLink: (link) ->
link.match(/-(\d+)\/?/)
oldLink: (link) ->
@adampash
adampash / firestore-connect.js
Last active November 4, 2017 00:07
HoC for connecting React components to Firestore
import React, { Component } from 'react';
// I used redux's compose b/c it was there, but you could of course compose however you wanted
import { compose } from 'redux';
// db is just the return of firebase.firestore() from an initialized Firebase
import { db } from './store';
// pipe and reduce are from https://github.com/adampash/pipe/blob/master/src/index.js
import { pipe, reduce } from './utils/pipe';
class FirestoreData extends Component {
constructor(props) {