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
{"lastUpload":"2019-07-16T15:17:08.352Z","extensionVersion":"v3.4.0"} |
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 { User } from './models' | |
export const isAuthenticated = req => { | |
if (!req || !req.session || !req.session.userId) { | |
// user is not logged in | |
throw new Error('Not authenticated!') | |
} | |
} | |
export const signOut = (req, res) => |
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
// By @coderitual | |
// https://twitter.com/coderitual/status/1112297299307384833 | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// Type this in your code to break chrome debugger in that line. |
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 mongoose, { Schema } from 'mongoose' | |
const userSchema = new Schema({ | |
name: String, | |
bio: String, | |
email: String, | |
password: String, | |
googleId: String, | |
githubId: String, | |
avatar: 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
/* eslint-disable react/display-name */ | |
/* eslin-disable */ | |
import React, { useState } from 'react' | |
import { Mutation } from 'react-apollo' | |
import { adopt } from 'react-adopt' | |
import { | |
Container, | |
Row, | |
Col, | |
Card, |
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 React from 'react' | |
import Img from 'gatsby-image' | |
import { graphql, useStaticQuery } from 'gatsby' | |
const query = graphql` | |
query { | |
images: allFile(filter: { extension: { regex: "/jpeg|jpg|png|gif/" } }) { | |
edges { | |
node { | |
extension |
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
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "ctrl+shift+a", | |
"command": "workbench.action.toggleActivityBarVisibility" | |
}, | |
{ | |
"key": "ctrl+shift+s", | |
"command": "workbench.action.toggleStatusbarVisibility" | |
} |
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
# name: simply | |
# Colors | |
set cyan (set_color cyan) | |
set yellow (set_color yellow) | |
set red (set_color red) | |
set blue (set_color blue) | |
set green (set_color green) | |
set orange (set_color ff8300) | |
set gray (set_color 666666) |
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
/** | |
* usage: | |
* <ul> | |
* <Repeat times="3"> | |
* <li>item</li> | |
* </Repeat> | |
* </ul> | |
* or | |
* <ul> | |
* <Repeat |
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.getElementsByTagName('button')[0].onclick = function () { | |
scrollTo(document.body, 0, 1250); | |
} | |
function scrollTo(element, to, duration) { | |
var start = element.scrollTop, | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
OlderNewer