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 app.todo-list | |
(:require #?(:clj [app.xtdb-contrib :as db]) | |
[hyperfiddle.electric :as e] | |
[hyperfiddle.electric-dom2 :as dom] | |
[hyperfiddle.electric-ui4 :as ui] | |
[xtdb.api #?(:clj :as :cljs :as-alias) xt])) | |
(e/def !xtdb) | |
(e/def db) ; injected database ref; Electric defs are always dynamic |
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 slifin.tdd2 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
(defn one-edit-away? [a b] | |
(cond (= a b) true | |
(> (Math/abs (- (count a) (count b))) 1) false | |
(= (first a) (first b)) (recur (subs a 1) (subs b 1)) | |
(and (= (count a) (count b)) | |
(= a (str (first a) (subs b 1)))) true | |
(and (> (count a) (count b)) |
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 BristolClojurians.interview | |
(:require [clojure.test :refer [deftest is]]) | |
(:gen-class)) | |
;; set is allowed | |
(defn unique? [string] | |
(= string (apply str (set string)))) | |
(deftest unique?-test | |
(is (= true (unique? "abc"))) |
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
CREATE TEMPORARY TABLE | |
view_range ( INDEX view_date(date) ) | |
AS | |
SELECT "2021-01-01" AS `date`, 1 AS overnight | |
UNION ALL | |
SELECT "2021-01-02" AS `date`, 0 AS overnight; | |
SHOW INDEX FROM view_range; |
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 slifin.io.weather | |
(:gen-class) | |
(:require [cheshire.core :as json] | |
[com.wsscode.pathom3.connect.indexes :as pci] | |
[com.wsscode.pathom3.connect.operation :as pco] | |
[com.wsscode.pathom3.interface.smart-map :as psm])) | |
(pco/defresolver ip->lat-long | |
[{:keys [ip]}] | |
{::pco/output [:latitude :longitude]} |
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
<?php | |
class B { | |
public static function A(int $a, int $b = NULL) { | |
return 5; | |
} | |
public static function C(int $a, string $hey) { |
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
activity_log = opening_line (qualifierFromTo|qualifierTo|qualifierRemoved)?+ | |
opening_line = entity identifiers (for <space> name)? <space> was <space> verb (<space> location)? <space> on datetime source period newline? | |
source = (by <space> name) | 'via Birdie' | 'by the automatic confirmation process' | |
qualifierFromTo = attribute <space> modificationFrom from to_string to period newline? | |
qualifierTo = attribute <space> modificationTo to period newline? | |
qualifierRemoved = attribute <space> 'was removed' period newline? |
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
<?php | |
class B { | |
public static function A(int $a, int $b = NULL) { | |
} | |
public static function C(int $a) { | |
return 2; |
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
<?php | |
class DrupalPassword | |
{ | |
/** | |
* Returns a string for mapping an int to the corresponding base 64 character. | |
* | |
* @return String map for base64. | |
*/ | |
public static function itoa64() : string |
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
#!/bin/sh | |
#_( | |
#_DEPS is same format as deps.edn. Multiline is okay. | |
DEPS=' | |
{:deps {clj-time {:mvn/version "0.14.2"}}} | |
' | |
#_You can put other options here | |
OPTS=' |
NewerOlder