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
<div> | |
<div class="tabs"> | |
<div class="switchy-tab active" data-section-id="section1">tab1</div> | |
<div class="switchy-tab" data-section-id="section2">tab2</div> | |
<div class="switchy-tab" data-section-id="section3">tab3</div> | |
</div> | |
<div className="sections"> | |
<div class="switchy-section active" id="section1">stuff 1 </div> | |
<div class="switchy-section" id="section2">stuff 2</div> |
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
module Services | |
class UserService | |
#command is an "ActiveModel" | |
def apply_command(user_id, command) | |
aggregate = UserAggregate.find_or_create_by_id!(user_id) | |
aggregate.with_lock do | |
user = user_value(aggregate) | |
event = command.apply(user) | |
new_user = event.apply(user) | |
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
# can arbitrary imperative code be chopped up into a loop with a functional step? | |
# "comm" indicates some communication to an external computer or otherwise side-effecty step | |
# order of them presumably matters | |
# code is made up. It's an arbitrary collection of steps and "if" statements | |
# BUT! it's very similar to actual code I found at the office. :) #java | |
# Note: I think the following transformation is harder in typed langs. | |
# I wish not to deal with that at the moment. Will accept any chance no matter how verbose or clunky. |
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
class CreateValueRecords < ActiveRecord::Migration[5.1] | |
def change | |
create_table :value_records, id: false do |t| | |
t.jsonb :body, null: false, default: {} | |
t.string :key | |
t.timestamps | |
end | |
execute "ALTER TABLE value_records ADD PRIMARY KEY (key);" | |
end |
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
class CreateStickmanVersions < ActiveRecord::Migration[5.1] | |
def change | |
create_table :stickman_versions do |t| | |
t.references :stickman, foreign_key: true | |
t.integer :version, null: false, default: 0 | |
t.jsonb :body, null: false, default: {} | |
t.jsonb :debug, default: {} | |
t.timestamps | |
t.index [:stickman_id, :version], unique: true | |
end |
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
Autonomic | |
Pivotal CF | |
Pivotal Labs | |
Tribalscale | |
Connected Labs | |
Helpful | |
Taplytics |
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
class Account < ActiveRecord::Base | |
#id integer | |
#first_name string | |
#last_name string | |
class Value | |
include Virtus.value_object | |
attribute :id, Integer | |
attribute :first_name, String |
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
class Account < ActiveRecord::Base | |
#id integer | |
#first_name string | |
#last_name string | |
class Value < Struct.new(:id, :first_name, :last_name) | |
end | |
def as_value |
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
mkdir -p www/fedwiki/wiki | |
cd www/fedwiki/wiki | |
sudo apt-get update | |
sudo apt-get install npm | |
npm install wiki | |
sudo nodejs node_modules/.bin/wiki --port 80 --url YOUR_DOMAIN_NAME | |
#CTRL-C the wiki to stop it once its running | |
printf 'YOUR_MOZILLA_PERSONA_EMAIL' > ~/.wiki/status/persona.identity #super important to use printf instead of echo | |
sudo nodejs node_modules/.bin/wiki --port 80 --url YOUR_DOMAIN_NAME #keep this running forever by any means you like |
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
<div> | |
<div>function(type, change) {</div> | |
<div> | |
<textarea id='code' style="width: 49%; height: 300px;"></textarea> | |
<textarea id='changes' style="width: 49%; height: 300px;"></textarea> | |
</div> | |
<div>}</div> | |
<input id="go" type="submit" onClick="go()" /> | |
<div id="checklist"></div> |
NewerOlder