Skip to content

Instantly share code, notes, and snippets.

View ulyssesdotcodes's full-sized avatar

Ulysses Popple ulyssesdotcodes

  • London, UK
View GitHub Profile
vector center = point(1, 'P', 0);
float scale = chf('scale');
float scale_expand_limit = 2;
float scale_expand = min((scale - 1) * 4, scale_expand_limit) * scale_expand_limit;
scale_expand = smooth(0, scale_expand_limit, scale_expand) * scale_expand_limit;
vector centroid = prim(0, "centroid", @primnum);
vector offset = centroid - center;
float noise_val = noise(centroid * 10);
vector offset_with_noise = offset * noise_val;
@ulyssesdotcodes
ulyssesdotcodes / cloudSettings
Last active March 21, 2021 11:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-03-21T11:37:08.279Z","extensionVersion":"v3.4.3"}
module Slider exposing (Model, Msg, init, update, view)
import Html exposing (..)
import Html.Attributes as A
import Html.Events exposing (..)
import Json.Decode as D
import String as S
type alias Model =
{ name : String
, min : Float

Keybase proof

I hereby claim:

  • I am ulyssesp on github.
  • I am ulyssesp (https://keybase.io/ulyssesp) on keybase.
  • I have a public key ASBvfzPuwXDyGxLzzDHHqIMMLVGA-mtfC22r2e0fJk60wwo

To claim this, I am signing this object:

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module AesonOSC where
import BasePrelude hiding (readMaybe)
import Data.Aeson
import Data.Aeson.Types
import Sound.OSC.Type
@ulyssesdotcodes
ulyssesdotcodes / .spacemacs
Last active February 18, 2017 22:01
My spacemacs
dotspacemacs-default-font '("Source Code Pro"
:size 18
:weight normal
:width normal
:powerline-scale 1.1)
(server-start)
(setq haskell-default-program "stack ghci")
@ulyssesdotcodes
ulyssesdotcodes / ParameterAlertDialog.java
Created August 14, 2015 21:59
An AlertDialog that allows you to adjust variable values
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
@ulyssesdotcodes
ulyssesdotcodes / Sphere
Last active August 29, 2015 14:22
GLSL talk
float intersectSphere(vec3 origin, vec3 direction, vec3 center, float radius) {
vec3 co = origin - center;
float b = dot(co, direction);
float a = dot(co, co) - radius * radius;
float d = b * b - a;
if (d <= 0.0) {
return -1.0;
}
@ulyssesdotcodes
ulyssesdotcodes / BufferTests.java
Last active August 29, 2015 14:20
BufferUntil
public void testBuffer() {
PublishSubject<String> stream = PublishSubject.create();
PublishSubject<Boolean> gate = PublishSubject.create();
ReplaySubject<String> test = ReplaySubject.create();
stream
.lift(TRx.bufferUntil(gate))
.subscribe(test);
We have many different types of data being loaded. Right now, we have Board and List<TrelloAction>, so we'll focus on those.
There are 2 possible data sources, the database and service.
For both of those, there are 3 possible states: NOT_LOADING, LOADING, and LOADED. Let's call this a LoadState enum.
This can be represented by a class TObjectLoadingState. It has three fields: LoadState mDbLoadState, LoadState mServiceLoadState, and TObject mData or List<TObject> mData.
BoardActivityData::State contains a TObjectLoadingState for each of the pieces of data being loaded.