This file contains 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
let isAnagram = (str1, str2) => { | |
if (str1.length !== str2.length) return console.log('false'); | |
let obj1 = {}, | |
obj2 = {}, | |
equal = str1.length; | |
for (let i = 0; i < str1.length; i++) { | |
(obj1[str1.charAt(i)]) ? obj1[str1.charAt(i)] += 1 : obj1[str1.charAt(i)] = 1; | |
(obj2[str2.charAt(i)]) ? obj2[str2.charAt(i)] += 1 : obj2[str2.charAt(i)] = 1; |
This file contains 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> | |
<script src="sample.js"></script> | |
<link rel="stylesheet" href="sample.css"> | |
</head> | |
<body> | |
<div id="mainDiv"> | |
<div id="innerDiv" style="padding: 10px"> | |
<div class="leftDiv"> |
This file contains 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
#mainDiv { | |
height: 100vh; | |
width: 100vw; | |
border: 1px solid red; | |
} | |
#innerDiv { | |
height: 100vh; | |
width: 100vw; | |
border: 1px solid green; |
This file contains 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
"use strict" | |
window.onload = () => { | |
let image2Src = null, | |
elem = document.getElementById('mainDiv'), | |
getImage1btn = document.createElement('button'), | |
getImage2btn = document.createElement('button'); | |
getImage1btn.innerHTML = 'getImage1Data'; | |
getImage2btn.innerHTML = 'getImage2Data'; |
This file contains 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 variables ***************************************************************************************************/ | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import {composeWithTracker} from 'react-komposer'; | |
import {Modal, Button} from 'react-bootstrap'; | |
import './deposit.css'; | |
/* React components ***************************************************************************************************/ | |
const Deposit = (props) => { |
This file contains 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
let XHR = (`onload` in new XMLHttpRequest()) ? XMLHttpRequest : XDomainRequest; //to support IE8 | |
let ipXhr = new XHR(), | |
weatherXhr = new XHR(); | |
let creatElement = function () { | |
let layoutBody = document.createElement('div'), | |
h1 = document.createElement('h1'), | |
p = document.createElement('p'), | |
img = document.createElement('img'), | |
h2 = document.createElement('h2'); |
This file contains 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 variables ***************************************************************************************************/ | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
/* React components ***************************************************************************************************/ | |
export default class Weather extends React.Component{ | |
constructor(props) { | |
super(props); | |
this.state = { | |
city: ``, |
This file contains 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
/** | |
* MONGOSE SCHEMA | |
* [questions-schema.js] | |
*/ | |
import mongoose from 'mongoose'; | |
const selectSchema = { | |
value: String, | |
label: String | |
}; |
This file contains 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 ignoreThisMessage(isUncaught, args, payload) { | |
var ignore = "Protocols, domains, and ports must match."; | |
if ( | |
payload && | |
payload.body && | |
payload.body.message && | |
payload.body.message.body && | |
!!~payload.body.message.body.indexOf(ignore) | |
) { | |
return true |
This file contains 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 { | |
GraphQLBoolean, | |
GraphQLEnumType, | |
GraphQLFloat, | |
GraphQLInputObjectType, | |
GraphQLInt, | |
GraphQLInterfaceType, | |
GraphQLList, | |
GraphQLObjectType, | |
GraphQLString, |
OlderNewer