Skip to content

Instantly share code, notes, and snippets.

View dminuoso's full-sized avatar

Victor Nawothnig dminuoso

View GitHub Profile
@dminuoso
dminuoso / random.rb
Created June 21, 2017 13:10 — forked from anonymous/random.rb
rand.rb
takeEven = lambda.select do |x|
x if x % 2 == 0
end
@dminuoso
dminuoso / random.rb
Created June 21, 2017 13:09 — forked from anonymous/random.rb
fp.rb
[0,1,2,3,4,5,6,7,8,9].select do |x|
x if x%2==0
end
if false
foo = 1
end
# is foo defined?
def process_defn
if false
case 42
when s {} then
when 42 then
return
end
end
return
end
[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,
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);
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));
// 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);
def capture_proc
proc { |*args| capture_haml { yield *args } }
end
- 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