This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// song using math | |
typedef struct { | |
int freq; | |
int hold; | |
} Tone; | |
Tone* nextNote(); | |
String song; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {object[]} dependencies A list of steps to do at each depth of the tree. | |
* dependencies[0] is invoked first, then we call dependencies[1] on each child action. etc. | |
* @param {function} dependencies.request A function that returns a promise. | |
* @param {function:object[]} dependencies.onSuccess A function to call after the promise from dependencies.request finishes. | |
* This function should return a list of objects to invoke the next depth dependency on. | |
* | |
* @param {function} onFinish What to do when everything node has been traversed. | |
*/ | |
DataLoader.walkTree = function(dependencies, onFinish) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; See: https://www.reddit.com/r/emacs/comments/3icpo7/take_a_break_every_3_hours/ | |
(defvar breaktime-timer nil | |
"Holds the running break timer (if any).") | |
(defvar breaktime-wait "3 hours" | |
"How long to wait for the next break.") | |
(defun breaktime--set-next-breaktime () | |
"If we kill a breaktime buffer, set another wait timeout" | |
(when (string= (buffer-name) "*breaktime*") | |
(setq breaktime-timer (run-at-time breaktime-wait nil 'breaktime--take-a-break)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pushCommit() { | |
git push origin $1:master; | |
} | |
function _pushCommit() { | |
local RECENT_COMMITS=`git log --pretty=oneline master..HEAD` | |
COMPREPLY=() | |
local cur | |
cur=$(_get_cword) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: emacs-lisp | |
env: | |
matrix: | |
- EMACS=emacs24 | |
- EMACS=emacs-snapshot | |
global: | |
- CASK=$HOME/.cask/bin/cask | |
before_install: | |
- sudo add-apt-repository -y ppa:cassou/emacs | |
- sudo add-apt-repository -y ppa:ubuntu-elisp/ppa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY : test | |
EMACS ?= emacs | |
CASK ?= cask | |
LOADPATH = -L . | |
ELPA_DIR = \ | |
.cask/$(shell $(EMACS) -Q --batch --eval '(princ emacs-version)')/elpa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'ert) | |
(require '<<<YOUR EMACS LISP PACKAGE UNDER TEST>>>) | |
(ert-deftest no-byte-compile-warnings () | |
"Byte-compile should not emit warnings" | |
(byte-compile-file "<<<YOUR EMACS PACKAGE.el>>>") | |
(switch-to-buffer "*Compile-Log*") | |
(let ((lines (buffer-substring (point-min) (point-max)))) | |
(should (not (string-match "Warning:" lines)) ) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('rect').click(function(e) { | |
var target = e.target, | |
$target = $(target); | |
if (target.count === undefined || target.count === 5) { | |
target.count = 0; | |
} | |
if (target.count === 0) { | |
$target.attr('fill', '#eeeeee'); | |
} else if (target.count === 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Requires | |
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
const chalk = require('chalk'); | |
const { exec } = require('child_process'); | |
const morgan = require('morgan'); | |
//Static Routes | |
app.use('/dist', express.static(path.join(__dirname, 'dist'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# /etc/init.d/garagerelay | |
# Carry out specific functions when asked to by the system | |
case "$1" in | |
start) | |
echo "Starting Relay" | |
/usr/local/bin/gpio write 7 0 | |
/usr/local/bin/gpio mode 7 out |