This file contains hidden or 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
| # Usage: | |
| def streaming | |
| chunked_response do |resp| | |
| resp.chunk do | |
| "before" * 5000 | |
| end | |
| resp.chunk do | |
| sleep(1) |
This file contains hidden or 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
| // Model | |
| var Todo = defineComponent(asModel, function() { | |
| // this would just be a normal component with extra methods | |
| // that define bindable attributes and other logic | |
| this.properties({ | |
| text: String, | |
| complete: Boolean | |
| }); |
This file contains hidden or 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
| // Flight Proposal: Groups | |
| // Its useful to be able to structure components together | |
| // so that we can manage their lifecycles. We currently | |
| // group components together using simple initialization | |
| // functions which give us a rough structure but don't | |
| // allow us to manage lifecycles easily which has given | |
| // rise to nested components. However, it's not desirable | |
| // to couple one component to another in this way and | |
| // departs from the self contained nature of Flight |
This file contains hidden or 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
| this.attributes({ | |
| thing: html.attribute('data-thing'), | |
| thong: null, | |
| url: html.attribute('action') | |
| }); | |
| this.attr.thing | |
| this.attr('thing'); |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <div id="test"> | |
| <a href="" data-ref="bubo">Thingz</a> | |
| <ul> | |
| <li data-ref="lots" data-action="ponce">1</li> | |
| <li data-ref="lots" data-action="mouseover:pants">2</li> | |
| <li data-ref="lots" data-action="mouseover:pants">3</li> | |
| <li data-ref="lots" data-action="mouseover:pants">4</li> |
This file contains hidden or 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
| num_chops = 16 | |
| slice_length = sample_duration(:loop_amen_full) / num_chops | |
| effects = [:distortion, :distortion, :slicer, :wobble] | |
| define :play_slice do |slice| | |
| if slice == 0 | |
| start = 0 | |
| else | |
| start = (1.0 / num_chops) * slice | |
| end |
This file contains hidden or 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
| # Welcome to Sonic Pi v2.0 | |
| use_bpm 140 | |
| in_thread do | |
| loop do | |
| 4.times do | |
| 3.times do | |
| sample :ambi_choir, amp: 0.8 | |
| sleep 2 | |
| end |
OlderNewer