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
//es6 | |
const fixMe = (num, fix) => Math.round(num * 10 ** fix) / (10 ** fix) | |
fixMe(48.48-66.11111111, 2) | |
//older version | |
var fixme=function(num, fix) { | |
var answer = Math.round(num*Math.pow(10, fix))/(Math.pow(10, fix)); | |
console.log(answer); | |
}; | |
fixme(1/3, 8); //=>0.33333333 (8 decimal places) |
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> | |
<title>localStorage Test</title> | |
<script type="text/javascript" > | |
var count = 0; | |
var storageHandler = function () { | |
alert('storage event 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
/* | |
"dependencies": { | |
"cheerio": "^0.22.0", | |
"request": "^2.79.0", | |
"sequelize": "^3.27.0", | |
"tedious": "^1.14.0" | |
} | |
*/ | |
var Sequelize = require('sequelize'); |
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 ids = { | |
github: { | |
clientID: 'Go github.com , click your avatar -> settings ->oauth application->set callback and application url ->', | |
clientSecret: '*****', | |
callbackURL: "http://localhost:3000/login/auth/github/callback" | |
}, | |
google:{ | |
clientID: 'Google API console -> create a project -> create your credentails -> set callback and application url ->enable google+ api', | |
clientSecret: '******', | |
callbackURL: "http://localhost:3000/login/auth/google/callback" |
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
<html> | |
<head> | |
<link href="style.css" rel="stylesheet"> | |
<link href="https://fonts.googleapis.com/css?family=Asset" rel="stylesheet"> | |
</head> | |
<body> | |
<div id = "space"> | |
<div id="container1"> | |
<div class="div1"><img src="https://247wallst.files.wordpress.com/2015/05/thinkstockphotos-158403411.jpg?w=200"></div> | |
<div class="div2"><img src="http://2.wlimg.com/product_images/bc-small/dir_115/3420934/fresh-orange-1671496.jpg"></div> |
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 | |
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again | |
EMAIL='YOUR_EMAIL' # edit this | |
PASS='YOUR_PASSWORD' # edit this | |
COOKIES='cookies.txt' | |
USER_AGENT='Firefox/3.5' |
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 * as actions from "./actions.js"; | |
const mapStateToProps = (state, ownProps) => ({ | |
test: state.test, | |
result: state.result, | |
loading: state.loading | |
}); | |
const mapDispatchToProps = (dispatch, ownProps) => ({ | |
addOne: () => { |
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 | |
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again | |
EMAIL='YOUR_EMAIL' # edit this | |
PASS='YOUR_PASSWORD' # edit this | |
COOKIES='cookies.txt' | |
USER_AGENT='Firefox/3.5' |
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 express = require('express'); | |
var cookieParser = require('cookie-parser'); | |
var session = require('express-session'); | |
var flash = require('express-flash'); | |
var handlebars = require('express-handlebars') | |
var app = express(); | |
var sessionStore = new session.MemoryStore; | |
// View Engines |
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 from "react"; | |
import ReactDOM from "react-dom"; | |
import configureStore from "./store/configureStore"; | |
const store = configureStore(); | |
const rootEl = document.getElementById("root"); |
OlderNewer