This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
takeEven = lambda.select do |x| | |
x if x % 2 == 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0,1,2,3,4,5,6,7,8,9].select do |x| | |
x if x%2==0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if false | |
foo = 1 | |
end | |
# is foo defined? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process_defn | |
if false | |
case 42 | |
when s {} then | |
when 42 then | |
return | |
end | |
end | |
return | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> ObjectSpace.each_object.inject([]) { |a, e| a << e if (e.class == Class && !e.ancestors.include?(Object)); a } | |
DEPRECATION WARNING: MissingSourceFile is deprecated! Use LoadError instead. (called from block in <main> at (pry):1) | |
=> [JbuilderTemplate, | |
ActiveRecord::Type::Serialized, | |
#<Class:0x007fd0789aac18>, | |
ActiveRecord::Type::Time::Value, | |
#<Class:0x007fd078a100e0>, | |
Concurrent::SynchronizedDelegator, | |
ActionDispatch::Response::Header, | |
Sprockets::LegacyTiltProcessor, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const searchWatchStart = (searchConstants, selectSearch, apiFn, handleError) => { | |
const searchCreators = createRequestCreators(searchConstants.FETCH_STATUS); | |
const loadResults = fetchEntity.bind(null, searchCreators, apiFn, { handleError }); | |
const selectMask = makeSelectMask(selectSearch); | |
return function* () { // eslint-disable-line func-names | |
let lastTask; | |
for (;;) { | |
const { wait } = yield take(searchConstants.START_SEARCH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { put, call, race, fork, take, cancel, select, delay, cancelled } from 'redux-saga/effects'; | |
import { makeSelectMask } from './selectors'; | |
import { createRequestCreators } from './actions'; | |
function* fetchEntity(entity, apiFn, opts, id, url) { | |
try { | |
yield put(entity.request(id)); | |
const { response, error } = yield call(apiFn, url || id); | |
if (response) { | |
yield put(entity.success(id, response)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The call with a callback to self | |
try { | |
winfo = windarea.getWindInfo2(LonLat.lat, LonLat.lon, this.time, wante, wpost); | |
//this.drawWind(ctx, p.x, p.y, winfo); | |
var MI = GribMgr.WindAtPointInTime(new Date(this.time*1000),LonLat.lat, LonLat.lon, | |
function(){this.drawWindArea(p, poslimit, windarea, ctx)}) | |
if (MI) | |
{ | |
winfo = new Wind(MI.Speed, MI.Heading); | |
this.drawWind(ctx, p.x, p.y, winfo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def capture_proc | |
proc { |*args| capture_haml { yield *args } } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- if Rails.env.production? | |
%script | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-15209814-7', 'auto'); | |
ga('send', 'pageview'); | |
%script |