Skip to content

Instantly share code, notes, and snippets.

@ryanbillingsley
ryanbillingsley / PointOnCircle.m
Created April 22, 2014 21:02
Finds a point on a circle with a given radius and degree
#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
#define DEGREES_TO_RADIANS(degrees) ((degrees) * (M_PI / 180.0))
- (CGPoint)determinePointOnCircleWithRadius:(int)radius Degree:(int)degree Center:(CGPoint)startPoint
{
float midX = startPoint.x + radius * cos(DEGREES_TO_RADIANS(degree));
float midY = startPoint.y + radius * sin(DEGREES_TO_RADIANS(degree));
return CGPointMake(midX, midY);
}

Keybase proof

I hereby claim:

  • I am ryanbillingsley on github.
  • I am ryanbillingsley (https://keybase.io/ryanbillingsley) on keybase.
  • I have a public key whose fingerprint is 192A 752F 7020 D730 B999 9359 71D7 977D 1F3F 01DA

To claim this, I am signing this object:

[0mGET /manifests/cd0ea095 200 10.433 ms - 112
Validating start url...
Building the project... { content:
{ start_url: 'http://www.bamideas.com/',
short_name: 'WwwBamideasCom' },
format: 'w3c' } D:\home\site\wwwroot\tmp\cd0ea095 [ 'windows', 'android', 'ios', 'chrome', 'firefox' ] false
Generating the Windows application...
Generating the Chrome application...
Generating the Firefox application...
Generating the Cordova application...
@ryanbillingsley
ryanbillingsley / Ability and Spec
Created February 9, 2011 18:28
Re: Issue 268
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new
case user.role
when "admin"
can :manage, :all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
@ryanbillingsley
ryanbillingsley / connect_async_basic_auth
Created April 22, 2011 16:31
Connect Async Basic Auth
cluster = require('cluster')
http = require('http')
connect = require('connect')
request = require('request')
sys = require('sys')
done = (success) ->
console.log("FN!" + success)
true
@ryanbillingsley
ryanbillingsley / DTMFSingle.xml
Created January 30, 2012 16:19
Simple Single Digit DTMF GRXML file
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<grammar xml:lang="en-US" version="1.0" root="ROOT" mode="dtmf" tag-format="swi-semantics/1.0" xml:base="file://C:/Billingsley/" xmlns="http://www.w3.org/2001/06/grammar">
<rule id="ROOT" scope="public">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
def building_commit
i = 0
body = "tree #{@tree}
parent #{@parent}
author CTF user <me@example.com> #{@timestamp} +0000
committer CTF user <me@example.com> #{@timestamp} +0000
Give me a Gitcoin #{i}"
@ryanbillingsley
ryanbillingsley / ffmpeg.sh
Last active November 14, 2016 15:50
Jason Snell's Automator service that converts to AIFF via ffmpeg.
for i in "$@" ; do /Users/jsnell/ffmpeg -i "$i" -map 0:0 -acodec pcm_s161e -ac 1 -out_sample_rate 44100 "${i%.*}.wav" ;
done