Skip to content

Instantly share code, notes, and snippets.

@cbilson
cbilson / conemu-hack.el
Created Jul 29, 2018
elisp to send powershell to ConEmu for eval (... don't ask)
View conemu-hack.el
;;
;; 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."
View MySurvivor.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;
View MineField.java
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 Feb 18, 2018
get a user's spotify playlists
View logged-in.html
<!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>
View ob-scriptcs.el
;;; 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.
View Cowspeak.java
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.
View Tractor1.txt
6
..x...
.x....
....x.
xx.x..
..x...
......
@cbilson
cbilson / ob-powershell.el
Created Feb 6, 2018
Rough draft: execute poweshell from emacs src blocks
View ob-powershell.el
;;; 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.
View rust-stuff.el
(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