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
// A view that you can drag to move the underlying window around, | |
// but other mouse events are still handled by the view. | |
class DraggableView: NSView { | |
var dragStart: Date? = nil | |
// This alone would be sufficient except that the final mouseUp | |
// after a drag gets handled by the view instead of ignored, | |
// so the user will accidentally click a button if they happened | |
// to start (thus end) their drag on one. | |
override var mouseDownCanMoveWindow: Bool { return true } |
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
#[derive(Deserialize, Debug)] | |
pub struct Submission { | |
#[serde(rename = "id")] | |
pub thing_id: String, | |
pub author: String, | |
pub title: String, | |
pub created_utc: f32, | |
pub score: i32, | |
pub url: 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
pub fn fn_a() -> u32 { 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
function(){!function(scope){"use strict";function F(arity,fun,wrapper){return wrapper.a=arity,wrapper.f=fun,wrapper}function F2(fun){return F(2,fun,function(a){return function(b){return fun(a,b)}})}function F3(fun){return F(3,fun,function(a){return function(b){return function(c){return fun(a,b,c)}}})}function F4(fun){return F(4,fun,function(a){return function(b){return function(c){return function(d){return fun(a,b,c,d)}}}})}function F5(fun){return F(5,fun,function(a){return function(b){return function(c){return function(d){return function(e){return fun(a,b,c,d,e)}}}}})}function A2(fun,a,b){return 2===fun.a?fun.f(a,b):fun(a)(b)}function A3(fun,a,b,c){return 3===fun.a?fun.f(a,b,c):fun(a)(b)(c)}function A4(fun,a,b,c,d){return 4===fun.a?fun.f(a,b,c,d):fun(a)(b)(c)(d)}function A5(fun,a,b,c,d,e){return 5===fun.a?fun.f(a,b,c,d,e):fun(a)(b)(c)(d)(e)}var _List_Nil={$:0};function _List_Cons(hd,tl){return{$:1,a:hd,b:tl}}var _List_cons=F2(_List_Cons);function _List_fromArray(arr){for(var out=_List_Nil,i=arr.length;i--;)o |
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 Main exposing (Flags, Model, Msg(..), init, main, subscriptions, update, view) | |
import Browser | |
import Browser.Navigation as Nav exposing (Key) | |
import Html exposing (Html, a, button, div, h1, img, li, text, ul) | |
import Html.Attributes as Attr | |
import Html.Events as Events | |
import Time | |
import Url exposing (Url) |
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 Main exposing (main) | |
import Array.Hamt as Array exposing (Array) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events | |
import Random | |
-- QUILT LIBRARY -- |
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 Quilt exposing (..) | |
import Array.Hamt as Array exposing (Array) | |
{-| A quilt is a datastructure for maintaining a Pinterest-like | |
grid of images. Each image is wrapped with a Cell which calculates | |
its width/height from the image, but scales the dimensions to | |
something that fits. |
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
#![allow(warnings)] | |
// This example stubs out a Conn wrapper around postgres::Connection | |
// and r2d2_postgres::PooledConnection so that my database functions | |
// like `insert_user(&conn)` can take my wrapper as an argument and | |
// work regardless of the underlying connection type. | |
// | |
// Example: | |
// | |
// // conn is r2d2::PooledConnection |
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
extern crate uuid; | |
#[macro_use] | |
extern crate soa_derive; | |
#[derive(StructOfArray)] | |
struct Thing { | |
a: String, | |
b: i32, | |
c: uuid::Uuid | |
} |
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
Warning: Each child in an array or iterator should have a unique "key" prop. | |
Check the top-level render call using <small>. See https://fb.me/react-warning-keys for more information. | |
in a | |
in MessagePanel | |
in div | |
in div | |
in Homepage | |
in div | |
in body |