Moved to quil wiki: https://github.com/quil/quil/wiki/Runnable-jar
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
var setTimeout, clearTimeout, setInterval, clearInterval; | |
(function () { | |
var executor = new java.util.concurrent.Executors.newScheduledThreadPool(1); | |
var counter = 1; | |
var ids = {}; | |
setTimeout = function (fn,delay) { | |
var id = counter++; | |
var runnable = new JavaAdapter(java.lang.Runnable, {run: fn}); |
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
(ns mouse-example | |
(:require [quil.core :as q])) | |
(def w 1000) | |
(def h 1000) | |
(def acc 500) | |
(let [id (atom 0)] | |
(defn next-id [] | |
(swap! id inc))) |
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
(ns example | |
(:require [quil.core :refer :all])) | |
(def initial-state | |
{:ball-x 200 | |
:ball-y 100 | |
:speed-x 10 | |
:speed-y 2 | |
:hit 0 |
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
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
require("awful.rules") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
-- My some helpful functions | |
require("util") |
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
(def ^:dynamic *self*) | |
(def ^:dynamic *sender*) | |
(defn process [f sender message] | |
(binding [*self* *agent* | |
*sender* sender] | |
(f message) f)) | |
(defn tell [actor message] | |
(send actor process *self* message)) |
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
Overridden callMethods | |
Default callMethods | |
Overridden callMethods2 | |
Expected: | |
Overridden callMethods | |
Overridden callMethods | |
Overridden callMethods2 |
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
(defn move-to-front [first others] | |
"Moves an item to the front of the list" | |
(cons first (remove #(identical? first %) others))) | |
(defn first-level [list] | |
"Returns a list of all first-level permutations." | |
(map #(move-to-front % list) list)) | |
(defn permute-deeper [depth list] | |
"Takes a list and a depth. Ignores the first few items according to the depth, and returns a list of all permutations for the rest." | |
(let [head-of-list (take depth list) | |
rest-of-list (drop depth list) |
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
package com.geekalarm.android; | |
import android.content.Context; | |
public class Application extends android.app.Application { | |
private static Context context; | |
public void onCreate(){ | |
context=getApplicationContext(); |
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
def can_modify? | |
if params[:id] == current_user.id.to_s | |
@user = current_user | |
else | |
redirect_to user_path(params[:id]) | |
end | |
end |