Skip to content

Instantly share code, notes, and snippets.

Jared Grippe deadlyicon

View GitHub Profile
View example.js
const DanielasAwesomePage = (props) => {
const {activeTab, otherOption} = props
return <div className="DanielasAwesomeMap">
...
</div>
}
const PageA = (props) => (
<DanielasAwesomePage
activeTab="TabA"
View wait_for_new_macbooks.rb
require 'httparty'
loop do
response = HTTParty.get('http://store.apple.com/')
if response.include?('http://images.apple.com/r/store/backsoon/1x-covers-animation-v3.gif')
puts "not yet"
sleep 10
else
break
end
View babel-question.md

Babel Question

whenever I use babel I notice my source becomes littered with coppies of code like this:

  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
View Can React be used to render Qt.md

Can React be used to render Qt?

I'm inspired by seif but it renders using QT

Can React be used to render Qt interfaces?

View RPG Campaign Idea.md

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.

View 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)
@deadlyicon
deadlyicon / main.js.erb
Last active Aug 13, 2016
Using webpack in the Rails asset pipeline
View main.js.erb
<% 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
%>
@deadlyicon
deadlyicon / Apology.txt
Last active Jul 30, 2016
My public apology to @keystonejs
View Apology.txt
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.
@deadlyicon
deadlyicon / State.md
Last active Jul 23, 2016
Thoughts on State
View State.md

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

You can’t perform that action at this time.