Skip to content

Instantly share code, notes, and snippets.

View vinbarnes's full-sized avatar

Kevin R. Barnes vinbarnes

View GitHub Profile
Lessons Steve Jobs wanted to pass on.
Written right before he died.
In his own words:
1. ON BUILDING A REAL COMPANY:
I hate it when people call themselves “entrepreneurs” when what they’re really trying to do is launch a startup and then sell or go public, so they can cash in and move on.
@vinbarnes
vinbarnes / Doorbell.env
Created May 16, 2023 14:48 — forked from noelhibbard/Doorbell.env
This gist shows how to pull the local stream from a Wyze camera and then push it to an RTMP server.
# Edit and rename this file and then place it in /etc/wyzecam-to-rtmp
WYZE_EMAIL="joeblow@example.com"
WYZE_PASSWORD="wyzepasshere"
WYZE_CAMERA_NAME="Doorbell"
RTMP_URL="rtmp://127.0.0.1/live/doorbell"
@vinbarnes
vinbarnes / setup.sh
Created March 30, 2022 14:15 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
;; helper functions
(defun kb/project-dir ()
"returns the current project's root path"
(let* ((pr (project-current t))
(pr-dir (project-root pr)))
pr-dir))
(defun kb/project-concat (path)
"appends provided path onto the current project's root path"
# https://guides.rubyonrails.org/active_record_callbacks.html#halting-execution
class Org < ApplicationRecord
before_destroy do
throw :abort unless no_user?
end
end
@vinbarnes
vinbarnes / solar_system_objects.sql
Created May 30, 2021 01:31 — forked from pamelafox/solar_system_objects.sql
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */
/*
Sales from an online furniture store
Collected by: https://www.khanacademy.org/profile/charlesb2000/
*/
CREATE TABLE sales(
ID INTEGER NOT NULL PRIMARY KEY
, transaction_date TEXT
, product TEXT
, price INTEGER
, payment_type TEXT
def counts(str)
str.chars.inject([]) do |memo, e|
if memo.last && memo.last[0].eql?(e)
memo.last[1] += 1
else
memo << [e, 1]
end
memo
end
class Test
def run
puts ">>> starting test run: #{self.class.name}"
setup
the_test_methods.each do |test_method|
puts "running #{self.class.name}##{test_method}"
send(test_method)
end
end

Test Title

heading

PARAGRAPH starts here.

Then continues on for a bit.