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
#!/bin/bash | |
pbcopy < ~/.ssh/id_rsa.pub |
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 React, { Component } from "react"; | |
import axios from "axios"; | |
import "./App.css"; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
posts: [], | |
error: "" |
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
function flatten(arr) { | |
return arr.reduce(function (flat, toFlatten) { | |
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten); | |
}, []); | |
} | |
function assertFlattenEquals(actual, expected, testName) { | |
if (JSON.stringify(actual) === JSON.stringify(expected)) { | |
console.log('\'' + testName + '\' test passed!'); | |
} else { |
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
function average(numbers) { | |
return sum(numbers) / numbers.length; | |
} | |
function sum(numbers) { | |
return numbers.reduce(function(a, b) { |
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 webpack = require('webpack'); | |
const myEnv = require('dotenv').config(); | |
................................... | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
API_KEY: JSON.stringify(myEnv.parsed.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
API_KEY=asdapsasdDAS#$234@#$ASLC()#(%OAIC)_VPOI)@POVIPDOIFOVA |
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 obj = { | |
prop: 1 | |
}; | |
console.log(obj.prop); // logs 1 | |
console.log(obj.prop2); // logs undefined | |
// If you want to delegate failed lookups to the prototype | |
// you use this technique | |
var obj2 = Object.create(obj); // this way the newly created object has access to the obj properties!!! |
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 React, { Component } from 'react' | |
import { Text, View } from 'react-native' | |
class HelloWorld extends Component { | |
render() { | |
return ( | |
<View> | |
<Text> | |
Hello World! | |
</Text> |
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 React, { Component } from 'react' | |
class HelloWorld extends Component { | |
render() { | |
return ( | |
<div> | |
Hello World! | |
</div> | |
) | |
} |