Skip to content

Instantly share code, notes, and snippets.

View bry4n's full-sized avatar
🤘
Retired

bry4n

🤘
Retired
  • Internet
View GitHub Profile
@bry4n
bry4n / get-watchers.js
Created August 31, 2017 19:18 — forked from kentcdodds/get-watchers.js
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
@bry4n
bry4n / pr.md
Last active August 29, 2015 14:21 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

# 6,357 Qualified Candidates
# 116 Qualified candidates with line items - $7,685
# 189 Line items WITHOUT invoice - $14,365
# 1,005 Line items WITH invoice - $23,500
# 1,194 Line items (with invoice, without invoice) - $37,865
qualified_candidate_ids = []
AbilityScreenApplication.includes({assessment: [:user, :candidate]}, :ability_screen).find_each do |asa|
next unless asa.assessment
# Usage:
#
# tracer = Rails::Tracer.new
# tracer.trace("user_find") do
# @user = User.find(1)
# end
#
# View report
# $ open user_find.html
{
"auto_complete": false,
"close_windows_when_empty": false,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
".svn",

git-scm

  • Move some constants to lib/constants.rb

  • Refactor & clean up DocsController

  • Refactor & clean up some Model classes (maybe using delegate or presenter pattern)

  • DRY up the Doc.search and Section.search (duplication)

@bry4n
bry4n / config.ru
Created March 1, 2012 14:36
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"
@bry4n
bry4n / gist:959681
Created May 6, 2011 20:04 — forked from schacon/gist:1
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
@bry4n
bry4n / Gemfile
Created November 1, 2010 16:42
Simple DSL web scraper using Nibbler + Nokogiri + Faraday (less 35 LOC)
source :rubygems
gem 'nokogiri'
gem 'faraday'
gem 'nibbler'