Skip to content

Instantly share code, notes, and snippets.

View rhysforyou's full-sized avatar

Rhys Powell rhysforyou

View GitHub Profile
@rhysforyou
rhysforyou / parking_lots.geojson
Last active August 29, 2015 13:56
A GeoJSON representation of all the parking lots on the UOW campus
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rhysforyou
rhysforyou / grid.scss
Created March 1, 2014 05:50
A responsive grid in 50 lines of Sass
$break-medium: "(min-width : 40rem)";
$break-large: "(min-width : 64rem)";
@mixin clearfix {
&:before,
&:after {
content: " ";
display: table;
}

Keybase proof

I hereby claim:

  • I am rpowelll on github.
  • I am rpowelll (https://keybase.io/rpowelll) on keybase.
  • I have a public key whose fingerprint is 8921 1B4D 92B8 55A7 EBA2 38BF 1E84 B500 ADBB D98B

To claim this, I am signing this object:

We couldn’t find that file to show.
@rhysforyou
rhysforyou / gist:9568001
Created March 15, 2014 14:18
Ruby's Enumerable mixin provides some great tools for manipulating collections. Some of those ideas can make our Objective C code much cleaner and more expressive.
// Grab and sort events we care about from the response dict
self.events = [[[response xxx_map:^id(id obj) {
// Transform dicts into event objects
NSAssert([obj isKindOfClass:[NSDictionary class]], @"Response from timetable API should be array of objects");
return [MTLJSONAdapter modelOfClass:[XXXEvent class] fromJSONDictionary:obj error:nil];
}] xxx_select:^BOOL(id obj) {
// Filter down to events that happen today
return [obj occursOnDayOfDate:self.date];
}] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
// Order events based on when they start
@rhysforyou
rhysforyou / application.html.erb
Last active August 29, 2015 14:05
Ember breaking for no apparrent reason
<!DOCTYPE html>
<html lang="en-AU">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Carpool</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
//
// RWPViewController.m
// Yo Catch
//
// Created by Rhys Powell on 4/08/2014.
// Copyright (c) 2014 Rhys Powell. All rights reserved.
//
#import "RWPViewController.h"
#import "RWPYoCatchModel.h"
{EditorView, View} = require 'atom'
Clipboard = require 'clipboard'
Gist = require './gist-model'
module.exports =
class GistView extends View
@content: ->
@div class: "gist overlay from-top padded", =>
@div class: "inset-panel", =>
// MARK: - Long Division
func printExactDivision(dividend: Int, divisor: Int) {
var remainder = dividend
var pastRemainders = Dictionary<Int, Int>()
var iteration = 0
do {
// Add previous remainder
pastRemainders[remainder] = iteration
@rhysforyou
rhysforyou / unlike_reblogs.rb
Created February 10, 2015 05:11
Unlike everything you've reblogged on Tumblr
require 'tumblr_client'
BLOG_URL = "rpowelll.moe"
Tumblr.configure do |config|
config.consumer_key = "xxxx"
config.consumer_secret = "xxxx"
config.oauth_token = "xxxx"
config.oauth_token_secret = "xxxx"
end