Skip to content

Instantly share code, notes, and snippets.

View brianloveswords's full-sized avatar
💭
computering

Brian J Brennan brianloveswords

💭
computering
View GitHub Profile
<audio id="alarm" src="alarm.ogg" controls></audio>
<script>
const alarmElement = document.getElementById('alarm');
const alarmTimes = [
new Date('2015-11-13 07:00 -0500'),
new Date('2015-11-13 08:00 -0500'),
new Date('2015-11-13 08:30 -0500'),
];
function playAlarm() {

echo example

echo writes characters to stdout (file descriptor 1) which is usually connected to your terminal. You can read way too much about file descriptors here: https://en.wikipedia.org/wiki/File_descriptor

$ echo "hi"
hi
extern crate hyper;
extern crate uuid;
use uuid::Uuid;
use hyper::server::{Request, Response};
use std::io::Read;
// If a github webhook client requests this route, after serving that request successfully
// it will never respond to another request from any client again.
fn hello(req: Request, res: Response) {
extern crate iron;
extern crate router;
use iron::status;
use iron::{Iron, Request, Response};
use std::io::Read;
use router::Router;
fn main() {
let mut router = Router::new();
// This if this handler receives two requests from GitHub the

Oh, this is org-mode

  • it’s a format/mode for emacs
  • it’s an outliner and a lot more

It’s kinda like markdown?

butinemacs
It’ssuperpowerful and rad
@brianloveswords
brianloveswords / fancy-newline.el
Last active May 18, 2019 03:39
An enhanced newline function for use with smartparens-mode.
(defun my-fancy-newline ()
"Add two newlines and put the cursor at the right indentation
between them if a newline is attempted when the cursor is between
two curly braces, otherwise do a regular newline and indent"
(interactive)
(if (and (equal (char-before) 123) ; {
(equal (char-after) 125)) ; }
(progn (newline-and-indent)
(split-line)
(indent-for-tab-command))
/*global Reveal*/
window.AUDIO_TIMER = 0;
Reveal.addEventListener('slidechanged', (event) => {
if (window.location.search.match(/(controls=false|postMessageEvents=true)/i))
return null;
const slide = event.currentSlide;
const options = slide.dataset;
Ladies and Gentlemen We Are Floating in Cyberspace: Learning to be a better developer through the teachings of Black Flag, My Bloody Valentine, and John Cage.
function celebrate(emoji, length) {
if (length <= 0) return;
const idx = Math.random() * emoji.length | 0;
process.stdout.write(emoji[idx]);
return celebrate(emoji, length - 1);
}
const celebrationEmoji = ["🎉","👏","🎂","🎊","💃","👍","🎈","🍰",];
celebrate(celebrationEmoji, 140);
#!/bin/sh
git rebase --interactive --autosquash \
$(git merge-base $(git symbolic-ref --short HEAD) master)