Skip to content

Instantly share code, notes, and snippets.

View blackwatertepes's full-sized avatar
Relaxing

Tyler J. Kuhn blackwatertepes

Relaxing
View GitHub Profile
@blackwatertepes
blackwatertepes / main.go.tmp
Last active April 22, 2022 19:20
Search Units - Code Templates
// FINISH ME
type Unit struct {
Id int
Location Location
UserRating float64
PriceInCents int
}
type Location struct {
Lat float64
@blackwatertepes
blackwatertepes / render_images_bookmarketlet.js
Last active November 24, 2019 22:50
Render Images from Circle CI Artifacts
/*
ONE_LINER: Creates images from URL's in the Circle CI Artirfacts tab!
FULL_DESCRIPTION:
1. Turns '.png' url's in the Circle CI Artifacts tab into viewable images
a. Organizes the images into sections, based off of their test file names
b. Renders the images with spacing, and outlines based off of their test names
- Example: [beforeEach, some named screenshot, some other named screenshot, afterEach]
c. Adds buttons to scale up/down the images for individual sections
2. Acts as a bookmarket for your Circle CI project

Keybase proof

I hereby claim:

  • I am blackwatertepes on github.
  • I am blackwatertepes (https://keybase.io/blackwatertepes) on keybase.
  • I have a public key ASCUEUtpiGL0EKIk0ISBbX7dobGZ5ghFaCA6vOfQ2CNrDAo

To claim this, I am signing this object:

Introduction

Scripts in this repo...

  • eos.js (Includes the eosjs lib, and sets the basic configuration. Do not run this directly)
  • tail.js (Logs the EOS node transactions. Start this first, in its own window)
  • new_account.js (Creates a new account)

Getting Started

  • Replace the httpEndpoint in eos.js with your EOS node http address
  • Replace the private/public keys in the new_account.js file with your eosio account keys
  • Run tail.js to view transactions
@blackwatertepes
blackwatertepes / report_size.md
Last active August 29, 2015 14:24
Job Report Sizes

Generating a distribution of report sizes

Jobs for the last # days

First, you'll need to generate a list of job.id's from reports generated in the last # days. Run the following in Mixpanel...

SELECT job_id
FROM public.reports AS reports
WHERE reports.updated_at > '2015-06-29 00:00:00'
@blackwatertepes
blackwatertepes / gist:9818837
Created March 27, 2014 21:06
Seeing Machines CSV script
# This converts the CSV generated from job #1 into an input CSV for job #2.
# usage: ruby csv_to_csv.rb <csv input filename> <csv output filename>
# if there is no output file given, one will automatically be generated, with the filename of 'converted_[input filename]'
require 'rubygems'
require 'csv'
require 'json'
#This converts a csv file to a slightly different csv.
#usage: ruby csv_to_csv.rb <csv input filename> <csv output filename>
# leaving out the output filename will result in a csv file with the same name as the input, and will have 'converted' in front of it.
require 'rubygems'
require 'csv'
require 'json'
@blackwatertepes
blackwatertepes / gist:8328340
Created January 9, 2014 02:18
Massive Query
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT(sv.value) FROM signal_processor_signal_values AS sv WHERE sv.item_id = si' at line 1: SELECT `signal_processor_items`.`id` AS t0_r0, `signal_processor_items`.`processor_id` AS t0_r1, `signal_processor_items`.`created_at` AS t0_r2, `signal_processor_items`.`updated_at` AS t0_r3, `signal_processor_items`.`default` AS t0_r4, `signal_processor_items`.`paused` AS t0_r5, `signal_processor_signal_values`.`id` AS t1_r0, `signal_processor_signal_values`.`signal_id` AS t1_r1, `signal_processor_signal_values`.`value` AS t1_r2, `signal_processor_signal_values`.`created_at` AS t1_r3, `signal_processor_signal_values`.`updated_at` AS t1_r4, `signal_processor_signal_values`.`lat` AS t1_r5, `signal_processor_signal_values`.`lng` AS t1_r6, `signal_processor_signal_values`.`begin_at` AS t1_r7, `signal_processor_signal_values`.`end_at` AS t1_r8, `signal_processor_signal_valu
@blackwatertepes
blackwatertepes / gist:8186711
Created December 30, 2013 19:23
Git Strangeness
[preproduction][~] git log
commit 61cec4a71dbea09af2b4c8072216adfa2d8bcc4c
Author: Tyler J. Kuhn <tyler@wargoats.com>
Date: Fri Dec 6 11:51:09 2013 -0800
if notes have no body, they get deleted
[preproduction][~] git status
# On branch preproduction
nothing to commit, working directory clean
[preproduction][~] git pull --rebase origin preproduction
@blackwatertepes
blackwatertepes / shortest_distance.rb
Created May 2, 2013 16:02
Shortest Driver Distance (Lyft)
require 'rspec'
module Trip
def distance(a, b)
lat_dist = (a[:lat] - b[:lat]).abs
long_dist = (a[:long] - b[:long]).abs
Math.sqrt(lat_dist**2 + long_dist**2)
end
def route_distance(*points)