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> | |
| <head> | |
| <meta name="description" content="Object Assign and Spread to return a new javascript object"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <script src="https://wzrd.in/standalone/expect@latest"></script> | |
| <script src="https://wzrd.in/standalone/deep-freeze@latest"></script> | |
| </head> |
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> | |
| <head> | |
| <meta name="description" content="Writing a Todo List Reducer"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <script src="https://wzrd.in/standalone/expect@latest"></script> | |
| <script src="https://wzrd.in/standalone/deep-freeze@latest"></script> | |
| </head> |
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> | |
| <head> | |
| <meta name="description" content="Writing a Todo List Reducer (toggling a todo)"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <script src="https://wzrd.in/standalone/expect@latest"></script> | |
| <script src="https://wzrd.in/standalone/deep-freeze@latest"></script> | |
| </head> |
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
| TEMPERATURES = [37, 42, -24, 39] | |
| def fahrenheit(T): | |
| return ((float(9)/5)*T + 32) | |
| def celsius(T): | |
| return (float(5)/9)*(T-32) | |
| print(list(map(fahrenheit, TEMPERATURES))) |
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 math | |
| # from b_estimates.models import BEstimate | |
| # | |
| # be_list = BEstimate.objects.all() | |
| be_list = list(range(4934)) | |
| # total_count = be_list.count() | |
| total_count = 4934 | |
| batch_count = 500 | |
| iterations = math.ceil(total_count / batch_count) |
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
| class MyObject(object): | |
| def __init__(self): | |
| self.my_value = 0 | |
| my_obj = MyObject() | |
| getattr(eval('my_obj'), 'my_value') | |
| setattr(eval('my_obj'), 'my_value', 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
| const increment = input => input + 1 | |
| const decrement = input => input - 1 | |
| const double = input => input * 2 | |
| const halve = input => input / 2 | |
| const initialValue = 10 | |
| const pipeline = [ | |
| increment, | |
| double, |
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 aws from "aws-sdk" | |
| import shortid from "shortid" | |
| import FilePreviews from "filepreviews" | |
| import { | |
| REACT_APP_S3_ACCESS_KEY_ID, | |
| REACT_APP_S3_SECRET_KEY, | |
| REACT_APP_S3_REGION, | |
| REACT_APP_S3_BUCKET_NAME, | |
| REACT_APP_FILEPREVIEWS_API_KEY, |
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
| let wait = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
| let foo = async () => { | |
| await wait(2000) | |
| await this._doSomething() | |
| } |
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 { compose, both, either, gte, prop, equals, __ } from "ramda" | |
| const OUR_COUNTRY = "France" | |
| const wasBornInCountry = compose( | |
| equals(OUR_COUNTRY), | |
| prop("birthCountry"), | |
| ) | |
| const wasNaturalized = compose( | |
| Boolean, |
OlderNewer