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 dom = cheerio.load(html); | |
dom('script').each((index, item) => { | |
if ('src' in item.attribs && !item.attribs.src.startsWith('http')) { | |
dom(item).remove(); | |
} | |
}); | |
const editedDom = dom.html(); |
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
select | |
t.relname as table_name, | |
array_to_string(array_agg(a.attname), ', ') as column_names, | |
i.relname as index_name | |
from | |
pg_class t, | |
pg_class i, | |
pg_index ix, | |
pg_attribute a | |
where |
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
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> | |
<style> | |
body { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
} |
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
#!/usr/bin/env bash | |
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/ | |
### | |
# Label definitions | |
### | |
declare -A LABELS | |
# Platform |
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 { MonoTypeOperatorFunction } from 'rxjs/interfaces'; | |
import { Observable } from 'rxjs/Observable'; | |
import { Operator } from 'rxjs/Operator'; | |
import { Subscriber } from 'rxjs/Subscriber'; | |
import { TeardownLogic } from 'rxjs/Subscription'; | |
class ThrowIfSubscriber<T> extends Subscriber<T> { | |
constructor( | |
private myDestination: Subscriber<T>, |
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
RewriteEngine On | |
# Remove trailing / | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Rewrite spiders to static html | |
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|msnbot|yahoo|Baidu|aolbuild|facebookexternalhit|iaskspider|DuckDuckBot|Applebot|Almaden|iarchive|archive.org_bot) [NC] | |
RewriteCond %{DOCUMENT_ROOT}/static%{REQUEST_URI}.html -f | |
RewriteRule ^(.*)$ /static/$1.html [L] |
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 cheerio from 'cheerio'; | |
import * as fs from 'fs'; | |
import * as mkdirp from 'mkdirp'; | |
import * as path from 'path'; | |
import * as puppeteer from 'puppeteer'; | |
import { routes } from './routes'; // Array of strings representing routes | |
const host = 'https://forcit.be/'; |
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
class MessageAuthenticationHelper | |
{ | |
const HMAC_TAG_NAME = 'tag'; | |
/** @var string The hash algorithm used for generating a HMAC */ | |
protected $hashAlgorithm = 'sha256'; | |
/** @var string The secret HMAC key. */ | |
protected $hmacKey; |