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
def limits(base=None, row=None): | |
if base: | |
row = base.find('table', {'class': 'CLPTable'})\ | |
.find('tr', {'class': 'results-row'}) | |
regex = ur"(.+); (H[0-9]+): (C (≥|>) ([0-9,]+)%|([0-9,]+)% (≤|<|<) C (≤|<|<) ([0-9,]+)%)([ *]*)" | |
else: | |
regex = ur"(.+)(): (C (≥|>) ([0-9,]+)%|([0-9,]+)% (≤|<|<) C (≤|<|<) ([0-9,]+)%)([ *]*)" | |
raw = row.find_all('td', {'rowspan': re.compile('[0-9]+')})[2]\ |
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
Couldn't match expected type `([Char], [Char])' | |
with actual type `[[Char]]' | |
Expected type: [([Char], [Char])] | |
Actual type: [[[Char]]] |
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
var v; | |
switch ( $(this).val() ) { | |
case 'tru': | |
v = true; | |
break; | |
case 'fls': | |
v = false; | |
break; | |
case 'null': | |
default: |
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
buyer = Balanced::Account.find customer_token | |
if seller.customer_token.nil? || seller.customer_token =~ /cus_/ | |
puts 'creating seller and setting token' | |
# this throws error | |
seller_account = Balanced::Marketplace.my_marketplace.create_account(:email_address => seller.email) | |
puts "I got this!" | |
seller_merchant_uri = seller_account.uri | |
seller.customer_token = seller_merchant_uri | |
puts 'seller token' |
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
# this is the reequest body as per dashboard | |
{ | |
"card_uri": null, | |
"meta": null, | |
"email_address": "alvena@carternader.info", | |
"name": null | |
} | |
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
Hey, | |
Watching Amanda Palmer's talk the other day (http://bit.ly/artofasking), reminded me I was going to personally thank everyone who's bough Why programmers work at night. But I got lazy :( | |
Thanks for being awesome! | |
And if you've read the book already, I'd love to hear what's missing. | |
Cheers, | |
~Swizec |
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 filter (predicate, list) { | |
return list.map(function (a) { | |
return predicate(a) ? [a] : null; | |
}).reduce(function (prev, current) { | |
return current ? prev.concat(current) : prev; | |
}, []); | |
} | |
function filter2 (predicate, list) { | |
return list.reduce(function (prev, current) { |
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
// Contrived example of destructuring objects where local context has different name for keys | |
// Think of it as "When giving a value, the context has a different name for it than when getting the value" | |
// LabelX becomes just X when you're a label. | |
// There are many reasons why this isn't (and maybe shouldn't be) possible | |
let makeInput = ({x, value}) => ( | |
<DoInputStuff /> | |
) | |
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
Hey,<br /> | |
<br /> | |
Thanks for checking out the React Indie Bundle.<br /> | |
Here are the 4 book chapters and 42min of videos we promised: | |
<ul> | |
<li><a href="https://www.youtube.com/watch?v=4MOkIG9sEBU&list=PLF8WgaD4xmjUfL4lo12ugd9ZIheP-sGrB&index=1&utm_source=drip&utm_medium=email&utm_campaign=react-bundle-sample">Build Web Apps with React JS and Flux</a> (3 videos)</li> | |
<li><a href="http://reactkungfu.com/assets/misc/sample.pdf?utm_source=drip&utm_medium=email&utm_campaign=react-bundle-sample">React.js by example</a> (book chapter)</li> | |
<li><a href="http://samples.leanpub.com/reactd3js-sample.pdf?utm_source=email&utm_medium=drip&utm_campaign=react-bundle-sample">React+d3.js</a> (book chapter)</li> | |
<li><a href="https://www.youtube.com/watch?v=dnZbOXvXE4Q&list=PLF8WgaD4xmjUfL4lo12ugd9ZIheP-sGrB&index=5&utm_source=email&utm_medium=drip&utm_campaign=react-bundle-sample">Build Apps with React Native</a> (4 videos)</li> | |
<li><a href="https://dl.dropb |
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
# You don't need tests | |
Unit tests are pointless. Integration tests are hard. Clicky tests are king. | |
You write a piece of code and you *know* it works. You just wrote it. You just ran it. You just saw it do everything you thought to try. Any unit or integration tests would have confirmed this. | |
Your PM gets your code and tries it out. They find a bunch of things you forgot. Bits of the spec that you missed, nuances in edge cases you didn't think of, strange things even the PM didn't think of. | |
The designer finds a bunch of crap that should've been obvious, but you're not a designer so you didn't think it was obvious. |