Skip to content

Instantly share code, notes, and snippets.

View cbilson's full-sized avatar

Chris Bilson cbilson

View GitHub Profile
@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."
@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;
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.
6
..x...
.x....
....x.
xx.x..
..x...
......
@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.

Emacs Settings

(defun cbilson/rust-mode-hook ()
(interactive)
(message "cbilson/rust-mode-hook...")
(cargo-minor-mode)
(local-set-key (kbd "C-c <tab>") #'rust-format-buffer)
(racer-mode +1)
(message "cbilson/rust-mode-hook: done"))
(use-package rust-mode