I hereby claim:
- I am j-em on github.
- I am jem_xyz (https://keybase.io/jem_xyz) on keybase.
- I have a public key ASBgKmLCK8W-kifO8GkKfJeQTOfkLaZ0J2bJyZcx8fLusAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System; | |
using JSIL; | |
using JSIL.Meta; | |
public static class Program { | |
public static int x = 10; | |
public static int y = 20; | |
public static void Main () { | |
dynamic document = Builtins.Global["document"]; |
object Collections extends App { | |
implicit class Collections[E](iterable: Traversable[E]) { | |
def mapIt[A](f: (E) => A): List[A] = { | |
iterable match { | |
case head :: body => f(head) :: body.mapIt(f) | |
case _ => List() | |
} | |
} | |
} | |
} |
Compiling "resources/public/js/main-100.js" failed. | |
clojure.lang.ExceptionInfo: failed compiling file:src-cljs-om/tack/job.cljs {:file #object[java.io.File 0x1d8ab0dc "src-cljs-om/tack/job.cljs"]} | |
at clojure.core$ex_info.invoke(core.clj:4593) | |
at cljs.compiler$compile_file$fn__3198.invoke(compiler.cljc:1254) | |
at cljs.compiler$compile_file.invoke(compiler.cljc:1216) | |
at cljs.compiler$compile_root.invoke(compiler.cljc:1291) | |
at cljs.closure$compile_dir.invoke(closure.clj:438) | |
at cljs.closure$eval3581$fn__3582.invoke(closure.clj:478) | |
at cljs.closure$eval3533$fn__3534$G__3524__3541.invoke(closure.clj:383) | |
at cljs.closure$eval3594$fn__3595.invoke(closure.clj:492) |
(defn m-bind [mv mf] | |
(if (nil? mv) | |
nil | |
(mf mv))) | |
(defn m-log [[step n] mf] | |
(println (str step (inc n))) | |
(m-bind [step (inc n)] mf)) | |
(defn operations [] |
def diff_str(str1, str2): | |
differ = difflib.Differ() | |
string_buffer = io.StringIO() | |
for char in differ.compare(str1, str2): | |
if char[0] == "+" or char[0] == " ": | |
string_buffer.write(char[2]) | |
return string_buffer.getvalue().encode() |
require 'benchmark' | |
test_string = "apples, pears # and bananas\ngrapes\nbananas !apples" | |
args = ["#", "!"] | |
# first try => | |
def r_remove_comments(str, markers) | |
formatted_string = "" | |
str.each_line do |line| | |
markers.each do |marker| |
class Teetime < ActiveRecord::Base | |
validates :user, format: { with: /\w/, message: "can only contains letters or numbers"}, uniqueness: true | |
validates :date, presence: true | |
validates :time, presence: true | |
validates :club_id, inclusion: {in: Club.all.map { |club| club.id }, message: "%{value} is not a valid club"} | |
belongs_to :club | |
def self.available_on(date, club) | |
# date comes in the format mm/dd/yyy | |
# club comes in the format "clubname" |
RSpec.describe Teetime do | |
it "return a list of Time object for a given date and for a club" do | |
av = Teetime.available_on("01/01/2014", "club1") | |
expect(av).to be_a(Array) | |
unless av.empty? | |
expect(av[0]).to be_a(Time) | |
end | |
end | |
end |