Skip to content

Instantly share code, notes, and snippets.

View mseeks's full-sized avatar
©️
1992

Matthew Sullivan mseeks

©️
1992
View GitHub Profile
requirejs.config({
paths: {
jquery: 'libs/jquery',
plates: 'libs/plates',
director: 'libs/director',
bootstrap: 'libs/bootstrap',
store: 'libs/store',
underscore: 'libs/underscore'
},
shim: {
define(['presenter', 'director'], function(Presenter, Director) {
var routes = {
'/issues': {
on: Presenter.Issue.list,
'/:id': {
on: Presenter.Issue.show
}
}
};
define(['jquery', 'store'], function($, Store){
var Issue = {
all: function(callback) {
$.getJSON('issues.json', function(issues) {
callback(issues);
});
},
get: function(id, callback) {
$.getJSON('issues/' + id + '.json', function(issue) {
callback(issue);
define(['jquery', 'bootstrap', 'plates', 'resource', 'underscore'], function($, Bootstrap, plates, Resource, _) {
var Issue = {
list: function(callback) {
Resource.Issue.all(function(issues) {
var template = $('#issue').html();
var bound = Plates.bind(template, issues);
$('.table').append(bound);
$('.issue').show();
console.log(bound);
});
@mseeks
mseeks / Calculator.java
Created February 19, 2013 02:49
A simple calculator.
package calculator;
import java.util.Scanner;
/**
* Calculator
* A class that offers simple calculator functionality.
*
* @author Matthew Sullivan
*/
@mseeks
mseeks / wiggle-1.clj
Last active December 15, 2015 03:19
The basics of wiggling.
(:use wiggle.core)
(! 'html {} ; takes three params - 'tag {:option "value"} & content
(! 'head {} ; you can use anything for the tag, it just plugs in what you type
(! 'title {} "Example")) ; make sure to include {} even if you have no options
(! 'body {} "This is a test!" ; you can nest until your hearts content!
(! 'div {:class "style"} "Hello, world!"
(! 'div {} "another bird's nest"))))
<html>
<head>
<title>Example</title>
</head>
<body>
This is a test!
<div class="style">
Hello, world!
<div>
another bird's nest
(:use wiggle.core)
(! 'html {}
(! 'head {}
(! 'title {} "Example"))
(! 'body {} "This is a test!"
(! 'div {:class "style"} "Hello, world!"
(! 'div {} "another bird's nest"))))
$.fileDownload('/url/to/download.pdf', {
successCallback: function (url) {
alert('You just got a file download dialog or ribbon for this URL :' + url);
},
failCallback: function (html, url) {
alert('Your file download just failed for this URL:' + url + '\r\n' +
'Here was the resulting error HTML: \r\n' + html
);
#cloud-config
---
write_files:
- path: /opt/bin/waiter.sh
owner: root
content: |
#! /usr/bin/bash
until curl http://127.0.0.1:2379/v2/machines; do sleep 2; done
coreos: