This is a very trivial example of using mirage with Ember Twiddle.
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
import Adapter from "ember-data/adapters/json-api"; | |
export default Adapter.extend(); |
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
module Magic | |
def self.respond_to?(method_sym, include_private = false) | |
if method_sym.to_s =~ /^contains_(.*)/ | |
true | |
else | |
super | |
end | |
end | |
def self.method_missing(m, *args, &block) |
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
module Magic | |
def self.respond_to?(method_sym, include_private = false) | |
if method_sym.to_s =~ /^find_where_(.*)$/ | |
true | |
else | |
super | |
end | |
end | |
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
module Magic | |
def self.respond_to?(method_sym, include_private = false) | |
#Logic to decide which methods to respond to. | |
end | |
def self.method_missing(m, *args, &block) | |
#dynamically handle method calls | |
end | |
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
Number.prototype.isCoprimeTo = function(num) { | |
if (this>num) var small = num, big = this; | |
else var small = this, big = num; | |
return (function(a, b) { | |
if (b == 0) return a; | |
return arguments.callee(b, a % b); | |
})(small, big) == 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
(ns words) | |
(use 'clojure.java.io) | |
(defn get-lines [fname] | |
(with-open [r (reader fname)] | |
(doall (line-seq r)))) | |
(defn divide [list] | |
(partition-all (/ (count list) 4) list)) |
I hereby claim:
- I am shidel-dev on github.
- I am joeshidel (https://keybase.io/joeshidel) on keybase.
- I have a public key whose fingerprint is 753D 97CF E6EB 09D7 973B 0754 11B7 FAC2 B8D8 72AF
To claim this, I am signing this object:
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
#=====bob | |
class Bob | |
hey:(words) -> | |
switch | |
when words.replace(/\s+/, '') == '' then "Fine. Be that way!" | |
when words == words.toUpperCase() then "Woah, chill out!" | |
when /\?$/.test(words) then "Sure." | |
else "Whatever." | |
module.exports = Bob |
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
// Shorthand for $(document).ready(); | |
$(function() { | |
$("#previous_frame").click(function() { | |
$(".frames").animate({ | |
left: '+=360' | |
}, 500) | |
}) | |
$("#next_frame").click(function() { |
NewerOlder