Skip to content

Instantly share code, notes, and snippets.

Nathan Youngman nathany

Block or report user

Report or block nathany

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nathany
nathany / multiselect.html
Created Nov 6, 2013
iOS 7.0.3 multiple select issue minimal test case
View multiselect.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>iOS Test</title></head>
<body>
<div data-role="page">
<div data-role="content">
@nathany
nathany / Drone.io
Last active Dec 22, 2015
CI setup for Go
View Drone.io
go get -d -v ./...
# get test dependencies
# go get -t will make this unnecessary in go 1.2 <https://codereview.appspot.com/12566046>
# go get launchpad.net/gocheck
# go get github.com/axw/gocov/gocov
# go get github.com/mattn/goveralls
@nathany
nathany / Gemfile
Last active Dec 21, 2015
Just another rescue project.
View Gemfile
source 'https://rubygems.org'
ruby '1.8.7'
# server
gem 'rails', '2.3.18'
gem 'thin'
group :production do
gem 'rack-ssl' # included in Rails 3 (config.force_ssl = true)
@nathany
nathany / ruby2.md
Last active Dec 20, 2015
Ruby 2.0 backwards incompatible changes
View ruby2.md

Ruby 2.0 backwards incompatible changes

From Peter Cooper's Walkthrough:

  • lines, bytes, chars, codepoints returned an Enumerator in 1.9 -> use each_lines, each_bytes, each_chars, each_codepoints instead for an Enumerator
  • # encoding: utf-8 is the default (which impacts regular expressions that expect it to be us-ascii, eg. vpim)
  • respond_to? on a protected method returns false (was true)
  • inspect doesn't use the redefined to_s
  • Array#values_at returns nil for each number outside of the array
  • CSV.dump & CSV.load are gone (object serialization)
@nathany
nathany / gist:5145088
Created Mar 12, 2013
Checking sass syntax in a Rails app
View gist:5145088
sass -c -I app/assets/stylesheets/ app/assets/stylesheets/**/*.scss
@nathany
nathany / app.rb
Created Feb 17, 2013
Configuring Nesta CMS to use Redcarpet and Pygments.rb.
View app.rb
require 'redcarpet'
require 'pygments'
class Syntactical < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
def block_code(code, language)
Pygments.highlight(code, lexer: language)
end
end
@nathany
nathany / CVE-2013-0156.rb
Created Jan 15, 2013
Applying the CVE-2013-0156 security fix to Rails 3.2.10 by hand, create this initializer.
View CVE-2013-0156.rb
# There are multiple weaknesses in the parameter parsing code for Ruby on Rails
# which allows attackers to bypass authentication systems, inject arbitrary SQL,
# inject and execute arbitrary code, or perform a DoS attack on a Rails application.
# This vulnerability has been assigned the CVE identifier CVE-2013-0156.
#
# https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/61bkgvnSGTQ
ActiveSupport::XmlMini::PARSING.delete("symbol")
ActiveSupport::XmlMini::PARSING.delete("yaml")
@nathany
nathany / flux.md
Last active Nov 15, 2015
blue light reduction and f.lux
View flux.md

https://www.apple.com/feedback/ipad.html

To modify screen colour temperatures during evening hours, I have been using the f.lux app on my Macs for years.

I was quite looking forward to using it on my iPad, particularly for reading, but it seems Apple has not provided the necessary documented APIs, nor is Apple allowing side loading of apps using Xcode 7. https://justgetflux.com/sideload/

This is why iPad will never replace the PC.

Hopefully you will open up the capabilities needed to make f.lux a first class app, or work with them to build the features into a future revision of iOS.

@nathany
nathany / checkers.go
Created Dec 8, 2012
Within Delta Custom Checker for gocheck
View checkers.go
type withinChecker struct {
*CheckerInfo
}
var Within Checker = &withinChecker{
&CheckerInfo{Name: "Within", Params: []string{"obtained", "delta", "expected"}},
}
func (c *withinChecker) Check(params []interface{}, names []string) (result bool, error string) {
obtained, ok := params[0].(float64)
You can’t perform that action at this time.