Skip to content

Instantly share code, notes, and snippets.

View jaredatron's full-sized avatar

Jared Grippe jaredatron

View GitHub Profile
@jaredatron
jaredatron / RPG Campaign Idea.md
Created October 1, 2016 17:17
RPG Campaign Idea

RPG Campaign Idea

You're playing an older and experienced character. But your characters has lost their memory somehow. Every now and then a chronological episode if your characters memories comes flashing back to you. In the form of a podcast episode you listen to between sessions.

Everyone could play older version of any character from any podcast the DM has listened to.

You could cripple the characters in some way to start from a lower or reset skill-set. Maybe you're playing children reincarnated so you have to discover your powers alone the same line as you've acquired them in your past life.

@jaredatron
jaredatron / promises.js
Created August 18, 2016 19:32
promises.js
const runLater = function(milliseconds){
return new Promise(function(resolve, reject){
setTimeout(function(){ resolve('a'); }, milliseconds);
})
}
runLater(2000).then(function(string){
string += 'b'
console.log(string)
@jaredatron
jaredatron / main.js.erb
Last active August 13, 2016 00:18
Using webpack in the Rails asset pipeline
<% require Bundler.root.join('lib/webpack') %>
<% Webpack.dependencies.each{ |dependency| depend_on(dependency) } %>
<%= begin
Webpack.compile
rescue Webpack::CompilationError => error
raise unless Rails.env.development?
html = "<h1>Webpack Error</h1><pre>#{Rack::Utils.escape_html(error.message)}</pre>"
"document.documentElement.innerHTML = #{html.inspect};"
end
%>
@jaredatron
jaredatron / Apology.txt
Last active July 30, 2016 20:08
My public apology to @keystonejs
Yesterday I said this on Twitter:
"@KeystoneJS fuck your POS Framework. You don't get it and your docks are filled with lies. You've hurt the community and you should stop."
What I said was cruel. I was frustrated and I lashed out. I hurt others because of my frustration and I'm very sorry.
There is no excuse for what I did.
I regret my actions and I sincerely apologize to @mxstbr and anyone else in the @KeystoneJS community who I might have offended.
@jaredatron
jaredatron / State.md
Last active July 23, 2016 04:25
Thoughts on State

State

State in reactatron uses resources. Resources are just an Rx stream with an initial value. They can also optionally have an emit method allowing you to manipulate the resource asynchronously.

This is ideal for rendering in react because you can bind any component to any number of resources anywhere in your VDOM tree. The resource stream is subscribe to upon mounting that component, the component is re-rendered anytime the stream is published to (buffered by requestAnimationFrame).

If multiple components are mounted and therefore subscribed to the same resource they, by default, share that resource. Resources can also be configured to have independent state per subscriber.

Resources can be setup and torn down when the number of subscriber moves to and from 0

@jaredatron
jaredatron / irbrc.rb
Created April 29, 2016 17:39
copy and paste in ruby console
class String
def copy
IO.popen('pbcopy', 'r+'){|c| c.print(self) }
puts 'copied'
self
end
end
def self.copy(*args)