- React is cool :)
props
are passed and do not changestate
is initally configured but can change- JSX is optional but needs to be compiled - its very helpful!
- JSX and ES6 can be used freely with
babel
via webpack/browserify/etc. - Lots of resources available online
- Big list of links
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
// | |
// Person.js | |
// | |
// This is a simple Person class. | |
// | |
// It doesn't do much, but it demonstrates the use of ES6 classes. Note that | |
// this code will most likely not work in old browsers directly. To 'compile' | |
// this down to the more widely accepted ES5, you could use Babel. | |
// |
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
# | |
# person.rb | |
# | |
# This is a simple Person class | |
# It really doesn't do much, but it demonstrates the use of classes in Ruby | |
# | |
class Person |
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
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ut fringilla nunc. Vestibulum ut ligula a est ultrices ultricies quis id tellus. Mauris eu dignissim nisi. Phasellus id magna vehicula, egestas tellus non, accumsan lectus. Vivamus sed tincidunt augue. In consequat sed erat et pretium. Sed nec ante pulvinar, convallis quam eget, placerat urna. | |
In eu lacus mattis, ultrices erat a, aliquam est. Aenean commodo quam vel sapien gravida tincidunt. Suspendisse potenti. Proin sed libero sed enim varius elementum. Duis blandit euismod ante, eu pharetra dui fermentum vel. Etiam hendrerit sit amet metus eget maximus. Aliquam erat volutpat. Nullam tortor enim, dapibus eu accumsan ut, finibus eu purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam velit lectus, laoreet et mauris bibendum, viverra imperdiet lorem. Cras vitae purus eu nulla pharetra suscipit. Fusce arcu eros, accumsan vel est in, ultrices pretium ipsum. Suspendisse potenti. Morbi aliquet justo id rh |
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
run ->(env) { | |
[ 200, { 'Content-Type' => 'text/plain' }, [ "Hello World" ] ] | |
} |
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
require 'logger' | |
require 'time' | |
require 'json' | |
require 'forwardable' | |
# A simple subclass that writes JSON logs | |
class JsonLogger < Logger | |
def format_message(severity, timestamp, progname, msg) | |
msg = {message: msg} unless msg.is_a? Hash | |
log = {timestamp: timestamp.iso8601, severity: severity}.merge(msg) |
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
<!-- | |
kindly provided by 'Knapster' | |
Ref: http://forum.kodi.tv/showthread.php?tid=139145&pid=1285390#pid1285390 | |
--> | |
<keymap> | |
<global> | |
<remote> | |
<channelplus>Notification(Keypress, channelplus, 1)</channelplus> | |
<channelminus>Notification(Keypress, channelminus, 1)</channelminus> |
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
(function(d, script) { | |
script = d.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.onload = function(){ | |
// remote script has loaded | |
}; | |
script.src = '//hi.kickassapp.com/kickass.js'; | |
d.getElementsByTagName('head')[0].appendChild(script); | |
}(document)); |
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
`ifconfig`.split(/^(?=\w)/).flat_map{|x| x.scan(/^(\w+).*inet ([0-9.]+)/m)} | |
#=> [["lo0", "127.0.0.1"], ["en0", "10.112.202.44"], ["vboxnet0", "192.168.59.3"], ["en4", "10.112.197.80"]] |
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 PS1="\$(osascript -e 'set Volume 10' && say 'jerk')$PS1" |