Skip to content

Instantly share code, notes, and snippets.

View jdan's full-sized avatar
🐫
- : int -> int -> int = <fun>

Jordan Scales jdan

🐫
- : int -> int -> int = <fun>
View GitHub Profile
-- Euler 183 Solution
-- by Jordan Scales (for CS370)
-- Feb 19, 2014
-- https://projecteuler.net/problem=183
-- Determines whether the given denominator of a reduced fraction leads to
-- a terminating decimal
terminates :: Integral a => a -> Bool
terminates 1 = True
terminates n
#include <iostream>
using namespace std;
int main() {
int lineCount = 0;
string line;
while (cin >> line) {
lineCount++;
@jdan
jdan / spotify.js
Last active August 29, 2015 13:57
var lame = require('lame');
var Speaker = require('speaker');
var Spotify = require('spotify-web');
var libxmljs = require('libxmljs');
var username = process.env.SPOTIFY_USERNAME;
var password = process.env.SPOTIFY_PASSWORD;
Spotify.login(username, password, function (err, spotify) {
if (err) throw err;
@jdan
jdan / nucleotides.js
Last active August 29, 2015 13:57
Different object-oriented design patterns for @j3 (Jeff Casimir)
/**
* Original (annotated)
* As declared here:
* https://github.com/jcasimir/exercism_solutions/blob/master/javascript/nucleotide-count/nucleotide-count.js
*/
var DNA = function(sequence){
/**
* sequencce, displayedMarkers, and acceptedMarkers are all exposed
*
* var d = new DNA(['A', 'T', 'A']);
if has('gui_running')
set background=dark
color base16-railscasts
syntax on
set tabstop=2
set expandtab
set guifont=Inconsolata:h22
set linespace=3
set guioptions=-
set -g prefix C-a
unbind C-b
set-option -g default-shell /bin/zsh
set -sg escape-time 1
set -g base-index 1
set -g pane-base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded .tmux.conf!"
@jdan
jdan / README.md
Last active August 29, 2015 14:01

domino

quick-n-dirty HTML markup generator

examples

var dom = require('./domino');
dom.ul.li.span.class('note')
@jdan
jdan / README.md
Created July 26, 2014 19:57
Isomer using @TooTallNate's ansi-canvas

output

@jdan
jdan / focus-styles.js
Created June 25, 2015 14:34
Some tests to determine if an element has a visual cue when focused
const VISUAL_INDICATOR_TESTS = [
function outline(style, focusStyle) {
// Fail if there are no differences in the element's outline
if (style.outline !== focusStyle.outline) {
return false;
}
// A focus outline that is not "none" is only valid if the outline
// also has a width
return focusStyle.outlineStyle !== "none" &&
let assert = require("assert");
let mockDom = require("./mock-dom");
describe("Landmarks plugin", function() {
let dom = null;
let plugin = null;
before(function(done) {
mockDom.createDom(function(domObj) {
// Assign `dom` to the new created jsdom