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
| // https://url/?timestamp=&UID=&secretKey= | |
| const express = require('express'); | |
| const crypto = require('crypto'); | |
| const app = express() | |
| const signature = (timestamp, uid, secretKey) => { | |
| const buf = Buffer.from(secretKey, 'base64'); | |
| const baseString = timestamp + "_" + uid | |
| const binaryBaseString = baseString.toString('binary') | |
| const sig = crypto.createHmac('sha1', buf).update(binaryBaseString).digest() | |
| console.log(sig.toString('base64')) |
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 express from 'express'; | |
| import http from 'http' | |
| /** | |
| * Express Set Up | |
| */ | |
| const app = express() | |
| app.set('view engine', 'pug') | |
| app.use('/assets', express.static('assets')); | |
| const server = http.createServer(app); | |
| const io = require('socket.io').listen(server); |
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
Show hidden characters
| { | |
| "presets": [ | |
| ["env", { | |
| "targets": { | |
| "node": "current", | |
| "browsers": ["last 2 versions", "safari >= 11.1","ie 8"] | |
| } | |
| }] | |
| ], | |
| "plugins": [ |
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
| Use instanceof for custom types: | |
| ``` | |
| var ClassFirst = function () {}; | |
| var ClassSecond = function () {}; | |
| var instance = new ClassFirst(); | |
| typeof instance; // object | |
| typeof instance == 'ClassFirst'; // false | |
| instance instanceof Object; // true | |
| instance instanceof ClassFirst; // true | |
| instance instanceof ClassSecond; // false |
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 classes from './Table.module.css'; | |
| const Row = props => { | |
| return props.keys.map((key) => { | |
| return <td key={props.data[key]}>{props.data[key]}</td> | |
| }) | |
| } | |
| const Table = ({ |
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
| :root { | |
| font-size: 16px; | |
| } | |
| @function pow($number, $exponent) { | |
| $value: 1; | |
| @if $exponent > 0 { | |
| @for $i from 1 through $exponent { | |
| $value: $value * $number; |
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
| const path = require('path'); | |
| // your app's webpack.config.js | |
| const custom = require('../build/webpack.base.js'); | |
| module.exports = async ({ config, mode }) => { | |
| return { ...config, | |
| module: { | |
| ...config.module, | |
| rules: custom.module.rules, | |
| }, |
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 { storiesOf } from '@storybook/react'; | |
| import React from 'react'; | |
| storiesOf('example', module) | |
| .add( | |
| 'example', | |
| () => ( | |
| <div> | |
| <div></div> | |
| </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
| # Theme | |
| ZSH_THEME="robbyrussell" | |
| # PATH exports | |
| PATH=$PATH:/usr/local/bin/; export PATH | |
| export PATH=/usr/local/share/npm/bin:$PATH | |
| export ZSH="/Users/xamkcm/.oh-my-zsh" | |
| # Alias's for git | |
| alias gs='git status' |
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
| default partial alphanumeric_keys modifier_keys | |
| xkb_symbols "pc105" { | |
| key <ESC> { [ Escape ] }; | |
| // The extra key on many European keyboards: | |
| key <LSGT> { [ less, greater, bar, brokenbar ] }; | |
| // The following keys are common to all layouts. | |
| key <BKSL> { [ backslash, bar ] }; |