Skip to content

Instantly share code, notes, and snippets.

View doublerebel's full-sized avatar

Charles Phillips doublerebel

View GitHub Profile
pointInPoly = (point,poly) ->
segments = for pointA, index in poly
pointB = poly[(index + 1) % poly.length]
[pointA,pointB]
intesected = (segment for segment in segments when rayIntesectsSegment(point,segment))
intesected.length % 2 != 0
rayIntesectsSegment = (p,segment) ->
[p1,p2] = segment
[a,b] = if p1.y < p2.y
@doublerebel
doublerebel / jake_autocomplete.coffee
Last active December 23, 2015 07:49 — forked from cayblood/rake_autocomplete.rb
Autocomplete bash script in Iced CoffeeScript for Jake/Jakefiles
#!/usr/bin/env iced
# Complete jake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default jake
# to your ~/.bashrc
# Bug-fix from Xavier Shay's version
# ported from Ruby/Rakefile version https://gist.github.com/cayblood/2499921
# to Node/IcedCoffee/Jakefile by doublerebel
# https://gist.github.com/doublerebel/6603667
//
// IPInsetLabel.h
// Instapaper
//
// Created by Marco Arment on 7/23/11.
// Copyright 2011 Instapaper LLC, released to the public domain.
//
#import <UIKit/UIKit.h>
@doublerebel
doublerebel / your_test.go
Last active March 11, 2024 11:34 — forked from epelc/your_test.go
Use pflags and regular `go test` flags in your tests
package yourpackage
import (
goflag "flag"
"fmt"
"os"
"strings"
"testing"
flag "github.com/spf13/pflag"