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
const fs = require('fs'); | |
const file = fs.createWriteStream('./big.txt'); | |
for(let i=0; i<= 1e6; i++) { | |
file.write('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n'); | |
} | |
file.end(); |
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
// http://eslint.org/docs/user-guide/configuring | |
module.exports = { | |
root: true, | |
parser: 'babel-eslint', | |
parserOptions: { | |
sourceType: 'module' | |
}, | |
env: { | |
browser: 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
const array = [ | |
{ | |
id:"1", | |
name: "john" | |
}, | |
{ | |
id:"2", | |
name:"danny" | |
} | |
] |
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
var initial = new Promise((resolve, reject) => { | |
setTimeout(resolve, 3000, 'first time!'); | |
}); | |
var p1 = Promise.resolve(3); | |
var p2 = 1337; | |
var p3 = new Promise((resolve, reject) => { | |
setTimeout(resolve, 100, 'foo'); | |
}); | |
initial |
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
// Current Persons Data Structure in Client | |
const clientData = [{ | |
id: 1, | |
employed: true | |
}, | |
{ | |
id: 2, | |
employed: false | |
}, |
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
componentDidUpdate(prevProps) { | |
for (const index in prevProps) { | |
if (prevProps[index] !== this.props[index]) { | |
console.log(index, this.props[index], '-->', prevProps[index]); | |
} | |
} | |
} |
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
const { ApolloServer, gql } = require('apollo-server'); | |
import typeDefs from './schema'; | |
import resolvers from './resolvers'; | |
import { makeExecutableSchema } from "graphql-tools"; | |
const { RedisCache } = require('apollo-server-cache-redis'); | |
import responseCachePlugin from 'apollo-server-plugin-response-cache'; | |
import postsApi from './datsource' | |
export const schema = makeExecutableSchema({ | |
typeDefs, |
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
const refresh = () => { | |
// refresh | |
}; | |
class LiranRedis extends RedisCache { | |
consutrctor() { | |
super(); | |
this.refresh = refresh; | |
} |
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
document.querySelectorAll('.match-results-card').forEach((node)=>{ | |
const hrefAttr = node.getAttribute('href'); | |
const window = window.open(hrefAttr); | |
console.log(window) | |
}) |
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
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"> | |
<circle style="fill: #32cbd6;" cx="256" cy="267" r="245"/> | |
<path style="fill:#D9EAFC;" d="M61.914,416.511C106.715,474.582,176.982,512,256,512c47.739,0,92.279-13.668,129.948-37.284V134.345 H61.914V416.511z"/> | |
<path style="fill:#C3DDF4;" d="M81.756,134.345H61.914v282.166c6.144,7.964,12.783,15.524,19.842,22.668V134.345z"/> | |
<rect x="61.914" y="35.902" style="fill:#02AF8E;" width="324.03" height="99.44"/> | |
<rect x="61.914" y="35.902" style="fill:#0F9390;" width="19.842" height="99.44"/> | |
<path style="fill:#1A2B63;" d="M376.391,0H71.472c-5.257,0-9.558,4.301-9.558,9.558v27.344h324.034V9.558 C385.948,4.301,381.647,0,376.391,0z"/> | |
<path style="fill:#52BBEF;" d="M347.98,295.832c0,1.965-1.608,3.573-3.572,3.573H201.505c-1.965,0-3.572-1.608-3.572-3.573v-95.744 c0-1.965,1.607-3.573,3.572-3.573h142.903c1.965,0,3.57 |
OlderNewer