Skip to content

Instantly share code, notes, and snippets.

View shsunmoonlee's full-sized avatar

Seunghun Sunmoon Lee shsunmoonlee

View GitHub Profile
@shsunmoonlee
shsunmoonlee / Chapter 1 - Cracking The Coding Interview Answers(Solutions) by Seunghun Lee
Last active September 11, 2017 07:26
Cracking The Coding Interview Answers(Solutions) by Seunghun Lee
1.1
String hasUniqueCharacters(String[] words) {
// compare the character with the entire sentence to find if they exist twice
for(int i=0; i< words.length; i++) {
for(int j=0; j<words.length && j!=i ; j++) {
if(words[i] == words[j]) {
return false
}
}
}
import './styles/RegistrationForm.css'
// import 'font-awesome/css/font-awesome.css'
import React from 'react';
import { HelpBlock, FormGroup, Form, Col, ControlLabel, FormControl, Checkbox, Button } from 'react-bootstrap';
import IBAN from 'iban';
class RegistrationFormRedux extends React.Component {
constructor(props) {
super(props);
// so I have an image inside <Layout> with margin-top: -255px;, which is sitting under nav bar. when I set style of Layout.Header as rgba(255,255,255,0.9) it's not set transparent. it seems there is a white layer underneath or sth. sorry if I'm wrong. I am a beginner.
<Layout.Header className="header">
</Layout.Header>
// css file
.header {
background: rgba(255,255,255,0.9);
height: 57px;
}
you should be seeing the page like images on the comment section
componentDidMount() {
const chartData = this.props.coinData.reduce((accumulator, currentValue, currentIndex, array) => {
accumulator.push({
...currentValue,
x: currentValue.market_cap_usd,
y: currentValue['24h_volume_usd'],
size: Math.abs(currentValue.percent_change_24h)
});
return accumulator
}, []);
render() {
let { sortedInfo, filteredInfo } = this.state;
sortedInfo = sortedInfo || {};
filteredInfo =
filteredInfo ||
{
rank: null,
name: null,
price_usd: null,
percent_change_24h: null,
fetch = (params = {}) => {
this.setState({ loading: true });
// Optionally the request above could also be done as
// console.log("fetch, limit", this.state.numberOfTopCoins, )
axios.get('https://api.coinmarketcap.com/v1/ticker/', {
params: {
convert: 'EUR',
start: 0,
limit: this.state.numberOfTopCoins,
}
@shsunmoonlee
shsunmoonlee / gist:3299cd1e8948390d25290e7f07e04086
Created May 2, 2018 10:02
Music Hackathon Ideas, Resources
https://blog.rapidapi.com/2017/01/31/microsoft-emotion-and-spotify-mood-music-project-api-smash/
https://developers.musimap.net/
https://umusic.app.box.com/s/wjpmxvvxbe2aoml00y574wv1q1gu40h4
Extract of streaming data (all kinds of platforms) for one week in April:
streams_11th_18th_April.csv (zipped)
module.exports = {
valueAtBit: function(num, bit) {
return (num).toString(2) & (bit).toString(2)
},
base10: function(str) {
return (str).toString(2)
},
convertToBinary: function(num) {