Skip to content

Instantly share code, notes, and snippets.

@csexton
csexton / app.js
Created June 21, 2021 16:29
Vue and Bootstrap Starter Template with CDN
window.addEventListener('DOMContentLoaded', (event) => {
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
});
@csexton
csexton / neopixel.c
Created April 2, 2021 18:02
NeoPixel light sequences with a serial USB interface
// Based on the NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
// Simple interface to run light sequences based on a single character
// code over serial over usb. Makes the interface on linux look something
// like this:
//
// echo -n 'a' > /dev/cu.usbmodem123
//
@csexton
csexton / mute-meet.scpt
Created January 8, 2021 18:56
Apple Script to toggle mute on Google Meet
tell application "Finder" to activate
tell application "Google Chrome"
activate
set i to 0
repeat with w in (windows) -- loop over each window
set j to 1 -- tabs are not zeroeth
repeat with t in (tabs of w) -- loop over each tab
if title of t starts with "Meet " then
set (active tab index of w) to j -- set Meet tab to active
set index of w to 1 -- set window with Meet tab to active
# frozen_string_literal: true
module Encryptable
ENCRYPTABLE_SALT = "iris.encryptable_salt"
def encrypt(string)
crypt.encrypt_and_sign(string)
end
def decrypt(encrypted_data)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.3
-----> Installing dependencies using bundler 2.0.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Using rake 12.3.3
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
@csexton
csexton / mov2gif.rb
Created July 3, 2019 17:43
Simple script to convert a mov file to an animated gif. Requires ffmpeg.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'optparse'
options = {
rate: 30,
log: 0,
}
@csexton
csexton / neopixel.cc
Created June 27, 2019 20:07
Simple Neopixel with serial command control
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
@csexton
csexton / main.go
Created June 27, 2019 19:48
Get the USB Serial Number from C in Go with IOKit
package main
// #cgo LDFLAGS: -framework CoreFoundation -framework IOKit
// #include <CoreFoundation/CoreFoundation.h>
// #include <IOKit/IOKitLib.h>
// #include <IOKit/serial/IOSerialKeys.h>
// #include <IOKit/usb/IOUSBLib.h>
//
// const char *
// getSerialNumber()
@csexton
csexton / local-rails.diff
Created June 2, 2019 16:17
Terrastories local dev mode
diff --git a/rails/Gemfile b/rails/Gemfile
index 0262b60..61d5bd8 100644
--- a/rails/Gemfile
+++ b/rails/Gemfile
@@ -6,6 +6,7 @@ ruby '2.5.1'
gem 'rails', '~> 5.2.0'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
+gem 'sqlite3'
# Use Puma as the app server
@csexton
csexton / ice.md
Created April 29, 2019 21:51
Icebreaker Questions

Icebreaker Questions

  • Is it okay for your job to be really boring if it pays well?
  • Describe yourself in one word (then say “does t follow directions)
  • Are you a different person by the end of each day?
  • If a waiter leaves an item off the bill and you say nothing, is that stealing?
  • Could you ever learn too much?
  • Would you be happy if you had all you wanted?
  • If you have to talk to someone for 2 hours, what topic would you pick?
  • Can you fall asleep fast?