Skip to content

Instantly share code, notes, and snippets.

Seva Baskin sevab

View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: [ 'utm_medium' ], // omit utm_source on purpose
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sevab
sevab / service_analyzer.rb
Last active May 18, 2018
Emebr Services Feature Analyzer
View service_analyzer.rb
services_dir_name = './app/services'
servise_dir = Dir.glob(File.join(services_dir_name, '**', '*'))
object_proxy_tests = [/ObjectProxy/, /_ProxyMixin/]
service_inject_tests = [/inject as service/]
alias_tests = [/alias/]
readonly_tests = [/readonly/]
observer_tests = [/observer/]
actions_tests = [/actions/]
exrtended_mixin_tests = [/EventedMixin/]
@sevab
sevab / to-relative-time.js
Last active Jan 24, 2016
Express past and future dates in relative words in JavaScript
View to-relative-time.js
/**
* A lighter version based on https://github.com/jherdman/javascript-relative-time-helpers
*
* Takes a date either in the future or the past and returns distance of time in words from that date up to now
*
* Examples:
*
* - current date:
* toRelativeTime(new Date())
* > 'Just now'
View decorating_boards.rb
class Board
def initialize ships
@ships = ships
end
def shoot coordinates
if coordinates == 1 # this would call the ships really
@ships = [0,0,-1,1]
return 'HIT'
end
You can’t perform that action at this time.