Skip to content

Instantly share code, notes, and snippets.

View tylergannon's full-sized avatar

Tyler Gannon tylergannon

  • Ciudad de Colon, Costa Rica
  • 21:42 (UTC -06:00)
View GitHub Profile
[dance_card_test] pwd 11:41:55 ☁ master ☂ ✖ ⚡ ✭
/Users/tyler/src/dev/dance_card_test
[dance_card_test] open github-mac://openrepo//`pwd` 11:41:57 ☁ master ☂ ✖ ⚡ ✭
The file /Users/tyler/src/dev/dance_card_test/github-mac:/openrepo/Users/tyler/src/dev/dance_card_test does not exist.
[dance_card_test] open github-mac://openrepo//Users/tyler/src/dev/dance_card_test 11:42:30 ☁ master ☂ ✖ ⚡ ✭
The file /Users/tyler/src/dev/dance_card_test/github-mac:/openrepo/Users/tyler/src/dev/dance_card_test does not exist.
[dance_card_test] open github-mac://openRepo/Users/tyler/src/dev/dance_card_test 11:43:02 ☁ master ☂ ✖ ⚡ ✭
The file /Users/tyler/src/dev/dance_card_test/github-mac:/openRepo/Users/tyler/src/dev/dance_card_test does not exist.
[dance_card_test] open github-mac://openRepo//Users/tyler/src/dev/dance_card_test 11:43:24 ☁ master ☂ ✖ ⚡ ✭
@tylergannon
tylergannon / gist:7690997
Created November 28, 2013 12:19
Use HTTParty gem for making HTTP requests over unix domain sockets.
###########################################################
# net/socket_http.rb
###########################################################
module Net
# Overrides the connect method to simply connect to a unix domain socket.
class SocketHttp < HTTP
attr_reader :socket_path
# URI should be a relative URI giving the path on the HTTP server.
@tylergannon
tylergannon / stylesheet.rb
Created October 17, 2016 04:11
Example PDF style declaration
module Stylesheet
extend ActiveSupport::Concern
include PdfStylesheet
PAGE_BREAK_RULES = [nil, 600, 200, 200, 100, 100].freeze
MARGIN_TOP_MM = 25
MARGIN_BOTTOM_MM = 30
MARGIN_LEFT_MM = 25
MARGIN_RIGHT_MM = 25
@tylergannon
tylergannon / config.py
Last active November 5, 2017 13:17
restful SGE sample configuration file
"""
module: config
Note that this module defines three classes for three different applications.
You are free in your own configurations, to define separate files.
# The Restfful SGE app only listens to the RestfulSgeConfig class.
Loads the application configuration file, checking the following places:
@tylergannon
tylergannon / Install-SingleApp.ps1
Last active June 22, 2018 23:19
Configure Git, Download Repository, Start Kubo inside of project.
# Command to run:
# $file = [System.IO.Path]::GetTempFileName(); (New-Object System.Net.WebClient).DownloadString('https://kubobuild.page.link/rniX') | Out-File -FilePath "${file}.ps1"; . "${file}.ps1"
& {
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if ($IsAdmin)
{
Write-Host -ForegroundColor Yellow "This should not be run as administrator."
@tylergannon
tylergannon / Install-BaseComponents.ps1
Last active June 23, 2018 00:28
Install base components for Kubo
& {
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if (-not $IsAdmin)
{
Write-Host -ForegroundColor Yellow "This needs to be run as administrator."
Write-Host -ForegroundColor Yellow "Please open a new powershell as administrator, and try again."
exit 2
@tylergannon
tylergannon / GreaterThanBST.kt
Last active March 22, 2019 05:51
Kotlin Red Black Tree. For a programming challenge. Instead of a key-value store, it returns the number of items added, whose value is greater than than the given key.
class GreaterThanBST {
private var root : Node? = null
fun add(key : Int) {
root = put(root, key)
}
operator fun get(key : Int) : Int = get(root, key)
@tylergannon
tylergannon / RBTree.rs
Last active November 25, 2025 17:55
Red Black Tree written in Rust
#![allow(dead_code)]
extern crate rand;
use std::cmp::Ord;
use std::cmp::Ordering;
use std::fmt::Debug;
use std::iter::Iterator;
use std::iter::IntoIterator;
use rand::Rng;
@tylergannon
tylergannon / vim.md
Last active August 1, 2019 09:51
vim cheat sheet
@tylergannon
tylergannon / JvmTest.kt
Last active May 8, 2022 23:34
Kotlin multiplatform with compose tests
class ModelContainerHostTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test fun firstTest() = runBlocking {
composeTestRule.setContent {
@Composable fun doAThing() = 1
doAThing() shouldBeExactly 2
}