Skip to content

Instantly share code, notes, and snippets.

View cbilson's full-sized avatar

Chris Bilson cbilson

View GitHub Profile
@cbilson
cbilson / ob-powershell.el
Created February 6, 2018 03:27
Rough draft: execute poweshell from emacs src blocks
;;; ob-powershell.el --- org-babel functions for powershell evaluation
;; Authors: Chris Bilson
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;;; Commentary:
;; Org-Babel support for evaluating powershell source code.
@cbilson
cbilson / Profile.ps1
Last active June 6, 2023 09:20
Current Profile. Contains a few TFS hacks...for if I ever need to use TFS again.
Set-StrictMode -version Latest
function Test-FileDep($a,$b) {
$bExists = test-path $b
$aTs = (Get-Item $a).LastWriteTime
return $bExists -and $aTs -le (Get-Item $b).LastWriteTime
}
function Update-Path($val) {
@cbilson
cbilson / README.md
Last active November 18, 2022 23:19
Messing around with screen capture -> http(hls)
@cbilson
cbilson / MySurvivor.java
Created June 13, 2018 16:07
Radar.java
import java.awt.Color;
import ihs.apcs.spacebattle.BasicEnvironment;
import ihs.apcs.spacebattle.BasicSpaceship;
import ihs.apcs.spacebattle.ObjectStatus;
import ihs.apcs.spacebattle.Point;
import ihs.apcs.spacebattle.RadarResults;
import ihs.apcs.spacebattle.RegistrationData;
import ihs.apcs.spacebattle.commands.BrakeCommand;
import ihs.apcs.spacebattle.commands.IdleCommand;
@cbilson
cbilson / hack.sh
Created April 5, 2012 09:51 — forked from makevoid/hack.sh
OSX For Hackers
#!/usr/bin/env sh
echo "Use current directory as default search scope in Finder"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
echo "Show Path bar in Finder"
defaults write com.apple.finder ShowPathbar -bool true
echo "Disable the Ping sidebar in iTunes"
defaults write com.apple.iTunes disablePingSidebar -bool true
@cbilson
cbilson / conemu-hack.el
Created July 29, 2018 16:09
elisp to send powershell to ConEmu for eval (... don't ask)
;;
;; ConEmu Functions
;;
(defvar cbilson/conemu-tab-id 0 "The current ConEmu PID or HWND.")
(defun cbilson/conemu-callback (process msg)
(message "conemu: %s" msg))
(defun cbilson/send-conemu-macro (macro &optional pid-or-hwnd)
"Send a command to ConEmu."
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
public class MineField {
public static int row;
public static int col;
public static void main(String[] args) {
@cbilson
cbilson / logged-in.html
Last active February 18, 2018 19:47
get a user's spotify playlists
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Clef</title>
</head>
<body id="home">
<h1>Logged in as {{user.display_name}}</h1>
<h3>Playlists</h3>
;;; ob-scriptcs.el --- org-babel functions for scriptcs evaluation
;; Authors: Chris Bilson
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;;; Commentary:
;; Org-Babel support for evaluating scriptcs source code.
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/*
* The animals are conspiring again. The cows are mooing very strangely and
* you’re certain of it. Your theory is that the length of each “MM” sound
* and the length of the “OO” sound can be translated to hexadecimal values
* and then converted to ascii. Create a program to translate cowspeak to
* English so you can find out what they’re up to.