Skip to content

Instantly share code, notes, and snippets.

View RyanBreaker's full-sized avatar

Ryan Breaker RyanBreaker

View GitHub Profile
@file:Suppress("unused")
package rocks.breaker.htmx
import kotlinx.html.HTMLTag
private fun joinModifiers(modifiers: List<String>) = modifiers.joinToString(prefix = " ", separator = " ")
/**
* [hx-get HTMX reference](https://htmx.org/attributes/hx-get/)
# For color
set-option -sa terminal-overrides ",xterm*:Tc"
# Enable mouse
set -g mouse on
# Set prefix
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
#shader vertex
#version 330 core
layout(location = 0) in vec4 position;
void main()
{
gl_Position = position;
}
@RyanBreaker
RyanBreaker / .js
Last active July 24, 2019 00:44 — forked from joepie91/.js
"Breaking out" of a promises chain
/* Short answer: don't. Use conditional branches instead. See below. */
Promise.try(function(){
return someAsyncThing();
}).then( (value) => {
if (value === 3) {
return "final value";
} else {
return Promise.try( () => {
return someOtherAsyncThing();
@RyanBreaker
RyanBreaker / wtfip.py
Last active December 2, 2018 00:51
A Python script that looks up and returns your public IP address. Requires the "requests" Python library to work.
#!/usr/local/bin/python3
# Requires the requests library to work:
# $ pip install requests
import json, requests, sys
url = 'https://wtfismyip.com/json'
r = None
@RyanBreaker
RyanBreaker / ipcalc.py
Last active November 8, 2018 13:22
Simple native Python 3 IP subnet calculator, no dependencies required. Inspired by http://jodies.de/ipcalc.
import sys, ipaddress
address = None
interactive = False
if len(sys.argv) > 1:
address = sys.argv[1]
else:
address = input('Network: ')
print('Hello, world!')
R1#show run
Building configuration...
Current configuration : 4002 bytes
!
! Last configuration change at 22:38:51 UTC Sat Sep 1 2018
!
version 15.6
service timestamps debug datetime msec
service timestamps log datetime msec
ansible-playbook 2.6.3
config file = None
configured module search path = [u'/Users/breaker/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/Cellar/ansible/2.6.3/libexec/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 2.7.15 (default, Aug 17 2018, 22:39:05) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
No config file found; using defaults
setting up inventory plugins
Parsed /Users/breaker/ans/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /usr/local/Cellar/ansible/2.6.3/libexec/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
@RyanBreaker
RyanBreaker / FlyCamera.cs
Last active November 27, 2023 04:40 — forked from gunderson/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour
{
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Reformatted and cleaned by Ryan Breaker 23-6-18