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
import { Controller } from "stimulus"; | |
export default class extends Controller { | |
static targets = ["count"]; | |
connect() { | |
this.setCount(); | |
} | |
checkAll() { |
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
// | |
<div data-controller="required-field" data-required-field-message="Email is required"> | |
<input name="email" data-target="required-field.field" ...> | |
</div> | |
<div data-controller="required-field" data-required-field-message="Password is required"> | |
<input name="password" data-target="required-field.field"> | |
</div> | |
// |
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
:plain | |
var existingModal = document.querySelector("[data-controller='modal']"); | |
if (existingModal) { | |
document.body.removeChild(existingModal); | |
} | |
document.body.insertAdjacentHTML("beforeend", "#{j render partial: template.to_s}"); |
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
"id": "MqdKxNWfuUSj0wAERp0G6p9qDAIZ", | |
"jerseyNumber": 59, | |
"name": { | |
"familyName": "Okine", | |
"givenName": "Earl" | |
}, | |
"position": "DEFENSIVE_END" | |
}, | |
"stats": { | |
"assistedTackles": 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
for position, min_limit, max_limit in POSITION_LIMITS: | |
position_cap = solver.Constraint(min_limit, max_limit) | |
for i, player in enumerate(all_players): | |
if position == player.position: | |
position_cap.SetCoefficient(variables[i], 1) | |
# add this section | |
flex_spot = solver.Constraint(1, 1) | |
for i, player in enumerate(all_players): |
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
what is `index/2` and why does elixir care about arity so much? | |
is mix like Rake or the Rails commands? both? neither? | |
what's the |> syntax? What's it called (ala hash-rocket)? | |
How do I do a `rails c` equivalent? | |
Is there something like `pry`? |
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
http://www.meetup.com/Open-Indy-Brigade/events/230315754/ | |
http://www.kizan.com/events/ | |
Hello-A member of the Microsoft team and a partner of ours suggested that I share this free hands-on Azure/IoT workshop with your group. The workshop will take place in Indianapolis on 6/7. Participants will use a Raspberry Pi Starter Kit to build a compelling IoT/Azure/BI story. More details and registration link are here http://www.kizan.com/events/ Please let me know if you have any questions and thank you in advance for sharing this opportunity with your group. | |
https://twitter.com/CircleCityCon | |
For next month: http://www.meetup.com/High-Fives-Happy-Hour/events/231546188/ |
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
> ruby -v | |
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin13] | |
> irb | |
irb(main):001:0> require 'csv'; CSV | |
=> CSV | |
> ruby -v | |
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin13] | |
> irb | |
irb(main):001:0> require 'csv'; CSV |
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
Hey there, I'm Ben, one of the developers working on FormKeep: the form backend for designers and developers. | |
Over the next few months, we're going to be investing heavily in the product and I want to make sure we're building the features that *you* want. To ensure that happens, would you please take this 5-minute survey? | |
I'm only sending this to a handful of our active users, so every response counts. I know it won't be the highlight of your week but it'll mean that future FormKeep changes will make it even better for you. | |
Side bonus: the entire survey is keyboard-navigable. No mouse required! | |
Thank you to the hundredth power :) |
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
Text.prototype.wordWrapWordBreak = function(text) { | |
var result = ''; | |
var lines = text.split('\n'); | |
var wordWrapWidth = this._style.wordWrapWidth; | |
for (var i = 0; i < lines.length; i++) { | |
var spaceLeft = wordWrapWidth; | |
var characters = lines[i].split(''); | |
for (var j = 0; j < characters.length; j++) { | |
var characterWidth = this.context.measureText(characters[j]).width; | |
if (j === 0 || characterWidth > spaceLeft) { |