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
public class CustomMatchers { | |
public static Matcher<View> withBackground(final int resourceId) { | |
return new TypeSafeMatcher<View>() { | |
@Override | |
public boolean matchesSafely(View view) { | |
return sameBitmap(view.getContext(), view.getBackground(), resourceId); | |
} | |
@Override |
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
// This is your Prisma schema file, | |
// learn more about it in the docs: https://pris.ly/d/prisma-schema | |
datasource db { | |
provider = "postgres" | |
url = env("DATABASE_URL") | |
} | |
generator client { | |
provider = "prisma-client-js" |
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 stop-worry.core | |
(:require ["react" :as react :rename {createElement $}] | |
["react-dom" :as dom] | |
[goog.object :as obj] | |
[cljs.core.async :as async])) | |
(extend-type object | |
ILookup | |
(-lookup | |
([o k] (obj/get o (name k))) |
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
{:paths ["."] | |
:deps {clansi {:mvn/version "1.0.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
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
match /rooms/{roomId} { | |
allow get | |
allow create: if | |
request.resource.data.keys().hasOnly(['hostId', 'timestamp']) && | |
request.resource.data.hostId == request.auth.uid && | |
request.resource.data.timestamp == request.time | |
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 useReconciler [reconciler effect-handler initial-state] | |
(let [[state&effects set-state] (react/useState {:state initial-state}) | |
[state effects] ((juxt get dissoc) state&effects :state) | |
dispatch (uix/callback | |
(fn [action] (set-state (fn [{:keys [state]}] (merge {:state state} (reconciler state action))))) | |
[reconciler])] | |
(uix/effect! | |
(fn [] | |
(when-not (empty? effects) | |
(doseq [effect effects :let [[type payload] effect]] |
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
Array.prototype.chunk = function (groupsize) { | |
var sets = []; | |
var chunks = this.length / groupsize; | |
for (var i = 0, j = 0; i < chunks; i++, j += groupsize) { | |
sets[i] = this.slice(j, j + groupsize); | |
} | |
return sets; | |
}; | |
var interleave = (a1, a2) => { |
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
// This is an example on how to use the library | |
import React from 'react'; | |
// This is the hook | |
function useReducerWithEffects(reducer, handlers, initialState) { | |
const [{ state, ...effects }, setState] = React.useState({ state: initialState }) | |
const dispatch = React.useCallback(action => setState(({ state }) => ({ state, ...reducer(state, action) })), [reducer]) | |
React.useEffect(function () { |
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 React from 'react'; | |
import './App.css'; | |
const actionType = { | |
SHOW: "show", | |
HIDE: "hide" | |
} | |
function reducer(state, action) { |
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
clojure -Sdeps '{:deps {clj-http {:mvn/version "3.10.1"}}}' -e '(use (quote clj-http.client)) (get "http://google.com")' |
NewerOlder