Skip to content

Instantly share code, notes, and snippets.

View robyurkowski's full-sized avatar

Rob Yurkowski robyurkowski

View GitHub Profile
namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
rcov = "rcov -Itest --rails --aggregate coverage.data -T -x \" rubygems/*,/Library/Ruby/Site/*,gems/*,rcov*\""
system("#{rcov} --no-html test/unit/*_test.rb test/unit/helpers/*_test.rb")
system("#{rcov} --no-html test/functional/*_test.rb")
system("#{rcov} --html test/integration/*_test.rb")

YARD CHEATSHEET yardoc.org

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
# @since 0.6.0
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@mars
mars / ember-data-global-ajax-params.js
Last active December 16, 2015 06:09
Add params to Ember Data's RESTAdapter AJAX requests.
App.accountId = 'asdf';
App.RESTAdapter = DS.RESTAdapter.extend({
// Scope all ajax calls.
ajax: function(url, type, hash) {
if (Ember.isEmpty(hash)) hash = {};
if (Ember.isEmpty(hash.data)) hash.data = {};
hash.data.account_id = App.accountId;
this._super(url, type, hash);
}
@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API
@alexspeller
alexspeller / base64encode.js.coffee
Last active December 21, 2015 04:38
Ember Table Extensions
# So, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error.
# If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect
# Excel totally sucking at encodings is the reason why. So, the workaround is, to use
# the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded
# as is with btoa. Note that if you use either of the workarounds on MDN, chars
# 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel
# to choke on these chars. Excel will still choke on chars > 255, but at least the £
# sign works now...
# [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
@tcjr
tcjr / messages.json
Last active December 25, 2015 06:59
Basic pagination with Ember
// The API accepts the page parameter and returns the pagination info in meta
{
"messages": [ ... ],
"meta": {
"pagination": {
"total_pages": 3,
"current_page": 1,
"total_count": 55
}
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@ugisozols
ugisozols / gist:9684528
Last active August 29, 2015 13:57
Overriding url that's being hit on the backend on a per model basis
// Problem.
//
// I wanted for this.store.find("account") in AccountRoute's model hook to hit /account instead of /accounts so I ended up
// creating App.AccountAdapter where I subclass App.ApplicationAdapter and override pathForType.
// See https://github.com/emberjs/data/blob/v1.0.0-beta.6/packages/activemodel-adapter/lib/system/active_model_adapter.js#L65
//
// Note: In my app I'm using DS.ActiveModelAdapter.
//
// <3 https://github.com/robyurkowski for help.
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.