Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gisikw on github.
  • I am cheerskevin (https://keybase.io/cheerskevin) on keybase.
  • I have a public key ASC_qwn65VfcEqp7UICYOXOPZ6b8YCqJsCqFqej0T7Fz5wo

To claim this, I am signing this object:

@gisikw
gisikw / AudioEditing.ahk
Created June 29, 2017 13:06
AutoHotKey script for faster audio recording and editing!
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2
; Jump to first marker, centered on screen
XButton1::
Send, {Del}
// IEEE 754 Single-precision floating point conversion library
// Kevin Gisi
// http://youtube.com/gisikw
//
// Note: Does not handle NaN, Infinity, -Infinity, or -0 special cases
// Further reading: https://www.wikiwand.com/en/Single-precision_floating-point_format
// Convert an IEEE 754 floating point bitstring to a number.
// Usage: to_float("01000001010001100000000000000000") => 12.375
function to_float {

Equidistant Satellites from Launch

This is a quick walkthrough about how you might calculate equidistant launches for a kOS-driven satellite network.

Note: It's unlikely that this will work perfectly. Tiny variations in how KSP handles air resistance, computing physics, etc, means that you'll still want to perform some minor corrections once these things get to orbit. This is the epitome of "sensitivity to initial conditions"

Starting Assumptions

Let's assume that we want to get four satellites equally spaced from launch. For convenience, we'll also assume that the orbital period is 360 seconds (you can get the real orbital period you're looking for using SHIP:OBT:PERIOD on the first craft you launch. This just makes the calculations simpler). Since we want them evenly spaced out, Satellite 2 should be 90° behind Satellite 1 in its orbit, with the same orbital period.

@gisikw
gisikw / redditShot.js
Last active May 8, 2016 22:24
Log the homepage position of a Reddit post.
var page = require("webpage").create(),
url = 'http://reddit.com?limit=100';
page.open(url, function (status) {
page.onUrlChanged = function(targetUrl) {
console.log('New URL: ' + targetUrl);
phantom.exit();
};
page.onCallback = function(msg) {
@gisikw
gisikw / gist:a2ffa7f45efa0d9c3bee
Created July 25, 2014 23:12
LIRC for Seiki TV Remote
begin remote
name seiki
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9046 4428
one 596 1606
@gisikw
gisikw / README.md
Created December 7, 2012 09:29
YouTube Centering

YouTube Centerer

Really simple Chrome extension to center the new YouTube Layout. Their width is constrained to 970, and there's no reason it can't be centered when your browser window is wider. All this script does is apply a quick style change across the full YouTube site. Note that this may change as YouTube revises its layout.

Installation

  • Download the youtube.user.js file
  • In Chrome, go to Tools -> Extensions
get '/some_page' do
@image_urls = Dir.glob('/public/images/portfolio/*.png')
haml :some_page
end
@gisikw
gisikw / Application1.rb
Created April 18, 2012 01:21
Dart: Ruby Example
# Code Snippet for
# Dart: A Replacement for JavaScript
# A talk given at Twin Cities Code Camp 12
# http://hasmanyreasons.com/2012/04/17/dart-why-you-should-care
# The following code demonstrates how Ruby can
# interact with multiple types with a single method
# definition.
def first(arg)
@gisikw
gisikw / Application1.java
Created April 18, 2012 00:59
Dart: Java Example
/*
* Code Snippet for
* Dart: A Replacement for JavaScript
* A talk given at Twin Cities Code Camp 12
* http://hasmanyreasons.com/2012/04/17/dart-why-you-should-care
*/
/*
* The following is a very basic Java program, which
* represents a Person, and outputs the String representation