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
<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
#!/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"); |
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 crypto = require('crypto'); | |
var dns = require('native-dns'); | |
var rest = require('restler'); | |
var server = dns.createServer(); | |
server.on('request', function (request, response) { | |
var domain = request.question[0].name; | |
if(domain == 'webutils.flourishworks.com') { | |
// Don't log this because it can't be uniquely identified and subsequently retrieved |
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
// Theory | |
// http://htmlpurifier.org/live/smoketests/xssAttacks.php | |
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
// A full collection of HTML5 related XSS attack vectors: | |
// https://github.com/cure53/H5SC https://raw.githubusercontent.com/cure53/H5SC/master/vectors.txt | |
// Short list | |
<script>alert("XSS: script tag")</script> | |
<script src="http://hackers-site.powertofly.com"></script> |
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
// semantic-ui-form.js | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Form, Input } from 'semantic-ui-react'; | |
export default function semanticFormField ({ input, type, label, placeholder, meta: { touched, error, warning }, as: As = Input, ...props }) { | |
function handleChange (e, { value }) { | |
return input.onChange(value); | |
} |
OlderNewer