Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bsullins's full-sized avatar

Ben Sullins bsullins

View GitHub Profile
@bsullins
bsullins / tesla-supercharger-signing.html
Last active March 28, 2019 20:12
Tesla Supercharger Wifi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Tesla Supercharger Wifi</title>
<link rel="stylesheet" type="text/css" href="https://d2b5ahqkvvrmo6.cloudfront.net/css/bootstrap.min.css" />
<script src="https://d2b5ahqkvvrmo6.cloudfront.net/js/jquery.min.js"></script>
<style>
body {
@bsullins
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
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
bsullins / .block
Last active March 18, 2018 17:48
Tesla List
license: mit
@bsullins
bsullins / .block
Last active March 17, 2018 22:52
Tesla List
license: mit
@bsullins
bsullins / .block
Last active March 17, 2018 22:23
Tesla Affordability Calc
license: mit
@bsullins
bsullins / netlify-loggly-redirect.txt
Created September 5, 2017 18:59
How to use Loggly and Netlify to get around ad-blockers
# 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/* https://logs-01.loggly.com/:splat 200
@bsullins
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
-- 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
bsullins / README.md
Last active May 4, 2023 08:19
Simple Force Layout in D3
@bsullins
bsullins / slide-o-matic.py
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
bsullins / README.md
Last active May 31, 2016 21:44
Game of Thrones Battles in D3