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
--
-- Is there a more efficient/elegant way to do this?
--
-- Objective: To disable/enable the mouse cursor for specific windows
--
checkMouseDisable :: X ()
checkMouseDisable = do
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 / ABI
Created April 6, 2012 20:11 — forked from 0xabad1dea/ABI
0x10c Programming Notes
On April 5 2012, #0x10c-dev agreed to the following standard ABI:
- Registers A, B, C are clobberable across calls
- Registers I, J, X, Y, Z are preserved across calls
- Return in A
- J is used for base stack pointer (preserving the value of SP before allocating data for locals)
[progressIndicator startAnimation:nil];
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
NSTask *task = [[NSTask alloc] init];
NSArray *arguments = [NSArray arrayWithObjects:@"-l", @"rvm", @"info", rubyName, @"ruby,homes,binaries,environment", nil];
NSPipe *pipe = [NSPipe pipe];
NSFileHandle *file = [pipe fileHandleForReading];
[task setStandardOutput: pipe];
[task setArguments: arguments];
[task setLaunchPath:@"/bin/bash"];
{-# LANGUAGE GADTs, EmptyDataDecls#-}
module Calculator where
type Stack = [Double]
-- Empty data declarations to use as 'tags'
data Unary
data Binary
data Left
package alphatunnel;
import java.io.IOException;
import java.io.FilterInputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.nio.CharBuffer;
import java.util.logging.Level;
import java.util.logging.Logger;