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
/* | |
A simple little SCSS mixin for creating scrim gradients | |
Inspired by Andreas Larson - https://github.com/larsenwork | |
https://css-tricks.com/easing-linear-gradients/ | |
*/ | |
@mixin scrimGradient($startColor: $color-black, $direction: 'to bottom') { | |
$scrimCoordinates: ( |
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
// @ts-check | |
"use strict" | |
/** | |
* Set up datadog tracing. This should be called first, so Datadog can hook | |
* all the other dependencies like `http`. | |
*/ | |
function setUpDatadogTracing() { | |
const { tracer: Tracer } = require('dd-trace') | |
const tracer = Tracer.init({ |
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 express = require('express') | |
module.exports = async function customServer(app, settings, proxyConfig) { | |
const handle = app.getRequestHandler() | |
await app.prepare() | |
const server = express() | |
if (proxyConfig) { | |
const proxyMiddleware = require('http-proxy-middleware') | |
Object.keys(proxyConfig).forEach(context => { |
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 express = require('express') | |
const next = require('next') | |
const Cache = require('lru-cache'); | |
const compression = require('compression') | |
const port = parseInt(process.env.PORT, 10) || 3000 | |
const dev = process.env.NODE_ENV !== 'production' | |
const app = next({ dev }) |
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
/** | |
* @param {number} yPos Pixels from the top of the screen to scroll to | |
* @param {number} duration Time of animation in milliseconds | |
*/ | |
const scrollTo = (yPos, duration = 600) => { | |
const startY = window.scrollY; | |
const difference = yPos - startY; | |
const startTime = performance.now(); | |
const step = () => { |
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 lang="en"> | |
<head> | |
<title>My App - Clipboard</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' chrome-extension://*;"> | |
</head> | |
<body> |
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
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
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 * as mongoose from 'mongoose'; | |
export let Schema = mongoose.Schema; | |
export let ObjectId = mongoose.Schema.Types.ObjectId; | |
export let Mixed = mongoose.Schema.Types.Mixed; | |
export interface IHeroModel extends mongoose.Document { | |
name: string; | |
power: 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
<VirtualHost *:80> | |
ServerName forum.example.com | |
Redirect permanent / https://forum.example.com | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName forum.example.com |
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 { TestBed, async, inject } from '@angular/core/testing'; | |
import { HttpClientModule, HttpRequest, HttpParams } from '@angular/common/http'; | |
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | |
import { HttpClientFeatureService } from './http-client-feature.service'; | |
describe(`HttpClientFeatureService`, () => { | |
beforeEach(() => { | |
TestBed.configureTestingModule({ | |
imports: [ |
NewerOlder