This file contains hidden or 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 { readFileSync } from "node:fs" | |
import * as babel from "@babel/core" | |
import BabelPluginReactCompiler from "babel-plugin-react-compiler" | |
import type { Plugin } from "esbuild" | |
import QuickLRU from "quick-lru" | |
export function ReactCompilerEsbuildPlugin({ | |
filter, | |
sourceMaps, | |
runtimeModulePath, |
This file contains hidden or 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
[ | |
{ | |
"id": 1, | |
"url": "https://images.dog.ceo/breeds/pointer-germanlonghair/hans2.jpg" | |
}, | |
{ | |
"id": 2, | |
"url": "https://images.dog.ceo/breeds/hound-english/n02089973_3480.jpg" | |
}, | |
{ |
This file contains hidden or 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
<Pagination | |
renderTableName{<b>Your Files</b>} | |
renderCallToAction={<BigButton>Upload</BigButton>} | |
totalPageCount={data.length / itemsPerPage} | |
> | |
{(pageNumber, reset) => ( | |
<TableHead> | |
<Header onClick={this.sortByName(reset)}>Name</Header> | |
<Header onClick={this.sortByTitle(reset)}>Title</Header> | |
</TableHead> |
This file contains hidden or 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
defmodule Operations do | |
@moduledoc """ | |
Examples: | |
operations Schema.Trip, :trip | |
operations Schema.User, :user, only: [:get, :delete] | |
# supports :plural option for list_x function | |
operations Schema.Datum, :datum, plural: :data | |
""" | |
defmacro operations(schema, name) do |
This file contains hidden or 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
{ | |
id: "123", | |
store: { | |
name: "GAP", | |
id: "123" | |
}, | |
name: "Winter Coat", | |
image_url: string, | |
sizes: ["small", "large"..], | |
color: ["green", "blue"] |
This file contains hidden or 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
defmodule RethinkDB.Response do | |
@moduledoc false | |
def parse(raw_data, token, pid) do | |
d = Poison.decode!(raw_data) | |
r = RethinkDB.Pseudotypes.convert_reql_pseudotypes(d["r"]) | |
profile = d["p"] | |
type = d["t"] | |
resp = case type do |
This file contains hidden or 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
defmodule AWS.S3 do | |
import AWS.Utils | |
@config Application.get_env(:vino, __MODULE__) | |
@allowed_file_types ~w(.jpeg .jpg .png) | |
def base_url(bucket) do | |
"https://#{bucket}.s3.amazonaws.com/" |
This file contains hidden or 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, { PropTypes } from 'react' | |
export default class TextareaAutosize extends React.Component { | |
static propTypes = { | |
value: PropTypes.string, | |
className: PropTypes.string, | |
style: PropTypes.object, | |
onChange: PropTypes.func | |
} | |
componentDidMount() { |
This file contains hidden or 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
defmodule MyApp.RethinkDB.Helpers do | |
def run(query, opts) do | |
query | |
|> MyApp.Database.run(opts) | |
|> handle_response | |
end | |
def run(query) do | |
run(query, []) |
This file contains hidden or 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
defmodule RethinkDB.Helpers do | |
def run(query) do | |
query | |
|> do_run | |
|> handle_response | |
end | |
def handle_response(%RethinkDB.Exception.ConnectionClosed{}) do | |
raise "Cannot connect to RethinkDB" |
NewerOlder