🤷♀️
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
var originalObject = { a: 1, b: 2 }; | |
var newObject = { c: 3 }; | |
var merged = { ...originalObject, ...newObject }; | |
var userIdObject = { id: 1 }; | |
var tonyObject = { name: "tony" }; | |
var c = { ...userIdObject, ...tonyObject }; |
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
var yourName = 'Max'; | |
var a = 'Hello ' + yourName; |
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 yourName = 'Max'; | |
const a = `Hello ${yourName}`; |
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
{ | |
"type": "File", | |
"start": 0, | |
"end": 245, | |
"loc": { | |
"start": { "line": 1, "column": 0 }, | |
"end": { "line": 16, "column": 0 } | |
}, | |
"program": { | |
"type": "Program", |
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 gql from 'graphql-tag'; | |
import { Query } from 'react-apollo'; | |
const GET_DOGS = gql` | |
{ | |
dogs { | |
id | |
breed | |
} | |
} |
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
app.use('/awdawdwad', (request, response, next) => { | |
// here is your code | |
}); | |
// Can also be written as: | |
const awdawdwadHandler = (request, response, next) => { | |
// here is your code | |
} | |
app.use('/awdawdwad', awdawdwadHandler); |
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 totalTypes = { | |
VIEWS: 2, | |
READS: 3, | |
FANS: 5 | |
}; | |
const getTotal = tableColumn => | |
[ | |
...document.querySelectorAll( | |
`td:nth-child(${tableColumn}) > span.sortableTable-number` |
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
def generator_expression(): | |
Fruit = collections.namedtuple( | |
'Fruit', ('name', 'size' | |
'price super_long_property_in_tuple')) | |
fruits = [ | |
Fruit( | |
name='apple', | |
size=5, | |
price=10.50, | |
super_long_property_in_tuple='super long string here also, lorem ipsum, maybe longer than 80 characters to look for pep8 violations here. lorem ipsum.'), |
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
def function_with_really_long_name( | |
normal_variable, | |
another_normal_variable, | |
configuration=None, | |
test_number=1, | |
test_text='dwadawa', | |
test_tuple=( | |
'LoremIpsum', | |
21)): | |
return None |
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 Basket(): | |
reference = models.CharField( | |
_('Project reference'), max_length=100, null=True) |