Skip to content

Instantly share code, notes, and snippets.

View DougPuchalski's full-sized avatar

Douglas Puchalski DougPuchalski

  • 111 Development LLC
View GitHub Profile
require 'rspec'
require 'webmock/rspec'
WebMock.disable_net_connect!
require 'httparty'
class MyClass
include HTTParty
@DougPuchalski
DougPuchalski / gist:328763e1de3cb08bc0b8
Last active August 29, 2015 14:14
When mixed into an Ember.Component class, actions can be explicitly or implicitly delegated to the parent.
/* jshint esnext: true */
import Ember from 'ember';
// When mixed into an Ember.Component class, actions can be explicitly or implicitly delegated to the parent.
// In general this makes the most sense for an app-level component, where actions are not mututated as they bubble
// up to higher levels.
export default Ember.Mixin.create({
// When true, all actions will be implicitly passed on to the parent
@DougPuchalski
DougPuchalski / gist:06bb8231bd0b62222b9d
Created November 27, 2014 18:58
Ember.js: modify EmberApp.prototype._processedTemplatesTree for custom template naming
EmberApp.prototype._processedTemplatesTree = function () {
var addonTrees = this.addonTreesFor('templates');
var mergedTemplates = mergeTrees(addonTrees.concat(this.trees.templates), {
overwrite: true,
description: 'TreeMerger (templates)'
});
var standardTemplates = pickFiles(mergedTemplates, {
srcDir: '/',
destDir: this.name + '/templates'
@DougPuchalski
DougPuchalski / resolver.coffee
Last active August 29, 2015 14:10
Ember.js: custom resolver
`import Ember from 'ember'`
`import Resolver from 'ember/resolver'`
Resolver.reopen
normalize: (fullName) ->
_name = @_super(fullName)
if _name.match(/\/-/)
_name = _name.replace('/-', '/_')
_name
@DougPuchalski
DougPuchalski / config.rb
Created April 3, 2013 18:43
RubyMotion/lib/motion/project/config.rb modified to detect circular dependencies
# Copyright (c) 2012, HipByte SPRL and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@DougPuchalski
DougPuchalski / blankslate.rb
Last active December 15, 2015 13:38
parslet with lock-o-motion. RubyMotion config must be updated to prevent circular dependencies from overflowing the stack. This seems a pretty clear RM oversight but I am surprised in the number of warnings generated. So far no problems with my app as a result. Parslet uses blankslate which in RM v1.34 crashes due to undefine issues. The stub he…
# TODO RM bug prevents the real version due to undefines I believe
class BlankSlate < BasicObject
def self.reveal(arg)
# NOP
end
end
@DougPuchalski
DougPuchalski / Gemfile
Created March 27, 2013 05:51
lock-o-motion failure on parslet
source 'https://rubygems.org'
gem 'colorize'
# RubyMotion unaware gems
group :lotion do
gem 'parslet'
end
@DougPuchalski
DougPuchalski / gist:1613816
Created January 15, 2012 01:42
Install Ruby Debug Gems for rbenv
# http://fullware.net/2012/01/14/install-ruby-debug-gems-for-rbenv/
export ruby_include=$HOME/.rbenv/versions/1.9.2-p290
gem install ruby-debug19 -- --with-ruby-include=$ruby_include
gem install ruby-debug-base19 -- --with-ruby-include=$ruby_include
gem install ruby-debug-base19x -- --with-ruby-include=$ruby_include
gem install ruby-debug-ide19 -- --with-ruby-include=$ruby_include
gem install ruby-debug-ide -- --with-ruby-include=$ruby_include