Skip to content

Instantly share code, notes, and snippets.

View bsullins's full-sized avatar

Ben Sullins bsullins

View GitHub Profile
bsullins / tesla-supercharger-signing.html
Last active March 28, 2019 20:12
Tesla Supercharger Wifi
View tesla-supercharger-signing.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Tesla Supercharger Wifi</title>
<link rel="stylesheet" type="text/css" href="" />
<script src=""></script>
body {
bsullins / second-highest-paid-employee.sql
Created October 2, 2018 21:59
How to find the second highest paid employee in a database - this was tested using SQL Server
View second-highest-paid-employee.sql
create table #employees (id int, salary int)
insert into #employees VALUES (1, 100);
insert into #employees VALUES (2, 200);
insert into #employees VALUES (3, 300);
-- first get rank
select id, salary, RANK() OVER (ORDER BY Salary DESC) as SalaryRank
from #employees
bsullins / .block
Last active March 18, 2018 17:48
Tesla List
View .block
license: mit
bsullins / .block
Last active March 17, 2018 22:52
Tesla List
View .block
license: mit
bsullins / .block
Last active March 17, 2018 22:23
Tesla Affordability Calc
View .block
license: mit
bsullins / netlify-loggly-redirect.txt
Created September 5, 2017 18:59
How to use Loggly and Netlify to get around ad-blockers
View netlify-loggly-redirect.txt
# If using JS as a source for loggly and Netlify
# Follow instructions on loggly to tell it to use a proxy
# Then on Netlify include a file in _site with the following
# This will redirect all your loggly entries and get around adblockers
/loggly/* 200
bsullins / hue-error.sql
Created October 12, 2016 16:33
I receive the error when trying to add a column to the list of the last select just before the count() aggregate
View hue-error.sql
-- checkout client data
select *
from clients;
-- how many rows do we have?
-- 35,749
select count(1)
from sales_all_years
-- inner join from sales
bsullins /
Last active May 4, 2023 08:19
Simple Force Layout in D3
bsullins /
Last active June 21, 2016 18:42
Auto-create slides
from pptx import Presentation
courseName = 'D3 The Big Picture'
courseSlug = 'd3-big-picture'
data = {
"slides": [
{"module_num": 1, "slide_title": "What is D3", "slide_layout": 0, "slide_type": "title"},
{"module_num": 1, "slide_title": "D3 History", "slide_layout": 2, "slide_type": "normal"},
bsullins /
Last active May 31, 2016 21:44
Game of Thrones Battles in D3