Skip to content

Instantly share code, notes, and snippets.

View DylanLukes's full-sized avatar

Dylan Lukes DylanLukes

  • University of California San Diego
  • San Diego, CA
View GitHub Profile
import Control.Monad
{- |
Instances of 'Monad' should satisfy the following laws:
* @`'skidoosh'` a `'smooshMap'` k = k a@
* @m `'smooshMap'` 'skidoosh' = m@
* @m `'smooshMap'` (\\x -> k x `'smooshMap'` h) = (m `'smooshMap'` k) `'smooshMap'` h@
public protocol MusicStaffViewElement {
/// The path that describes the shape of the element in the element's bounding box. This should be used in concert with `aspectRatio` and `heightInStaffSpace` to determine the actual shape and size of the bounding box when drawing.
func path(in frame: CGRect, for direction: MusicStaffViewElementDirection) throws -> CGPath
/// Returns a CALayer containing the element to be drawn.
///
/// - Parameter spaceWidth: The width of the spaces between the lines of the staff.
/// - Returns: The layer to be drawn by `MusicStaffView`
func layer(in clef: MusicClef, withSpaceWidth spaceWidth: CGFloat, color: UIColor?) throws -> CALayer
@DylanLukes
DylanLukes / Example.g4
Last active November 7, 2017 22:21
An implementation of PositionAdjustingLexer (for the Swift runtime) which does not require inline @members definitions.
lexer grammar Example;
options {
language=Swift;
superClass=MyBaseLexer;
}
@header {
// All that is needed here is some very simple conformance boilerplate.
// No inlined method definitions, no editing Swift source in a .g4 file.
package com.emg.slidedeck.agent.safeindex
import scala.language.{higherKinds, implicitConversions}
import scalaz.Alpha.{F, G, T}
sealed trait TCBox[TC[_]] {
type T
val value: T
val evidence: TC[T]
}
package com.emg.slidedeck.js.macros
import scala.collection.immutable.Seq
import scala.meta._
import scala.meta.dialects.Paradise211
class ScalaJSDefinedApply extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
def extract(trt: Defn.Trait): Seq[(Term.Name, Option[String], Type, Term)] = {
trt.collect {
package com.emg.slidedeck.js.macros
import scala.collection.immutable.Seq
import scala.meta._
import scala.meta.dialects.Paradise211
class ScalaJSDefinedApply extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
package com.emg.slidedeck.js.sui
import com.emg.slidedeck.js.macros.ScalaJSDefinedApply
import japgolly.scalajs.react.CtorType.ChildArg
import japgolly.scalajs.react.{Children, JsFnComponent}
import scala.scalajs.js
import scala.scalajs.js.{UndefOr, |}
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
import scala.collection.immutable.Seq
import scala.meta._
class ScalaJSDefinedApply extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
def collectFields(trt: Defn.Trait) = {
val params = trt.collect {
case dv @ Defn.Val(_, pats, Some(tpe), q"js.undefined") =>
pats.map { case Pat.Var.Term(name) =>
(name, tpe, q"js.undefined")
/** Declaration file generated by dts-gen */
export class Accordion {
constructor(...args: any[]);
componentWillMount(): void;
render(): any;
static Content(props: any): any;
static autoControlledProps: string[];
}
export class AccordionTitle {

Keybase proof

I hereby claim:

  • I am DylanLukes on github.
  • I am morphism (https://keybase.io/morphism) on keybase.
  • I have a public key whose fingerprint is 2D52 23DE 2B55 F0E3 9DC1 851B 0B65 C53E 1F9C 63BC

To claim this, I am signing this object: