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> | |
<meta charset="UTF-8"> | |
<title>MSE Demo</title> | |
</head> | |
<body> | |
<h1>MSE Demo</h1> | |
<div> | |
<video controls width="80%"></video> |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
addEventListener("fetch", event => { | |
event.respondWith(handle(event.request)); | |
}); | |
const urls = { | |
'certificate': 'https://static.eventials.com/evCertificate/assets/ev-certificates.$HASH.js' | |
} | |
const hashes = { | |
'certificate': '79fa861b49cdc1a2f7aa' |
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
# -*- coding: utf-8 -*- | |
class Topic(object): | |
_receivers = {} | |
def __init__(self, topic_name): | |
self._topic_name = topic_name | |
def subscribe(self, receiver): |
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 { join, resolve } = require('path') | |
const { main } = require(join(__dirname, 'package.json')) | |
const TerserPlugin = require('terser-webpack-plugin') | |
const rules = [ | |
{ | |
test: /\.(js|jsx)$/, | |
loader: 'babel-loader', | |
}, | |
{ |
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
use strict; | |
my $filename = $ARGV[0]; | |
my $line = $ARGV[1]; | |
open my $fh, '<', $filename or die "Can't open file $!"; | |
my $file_content = do { local $/; <$fh> }; | |
my $regex = qr/$line.*?(?=AUTO_INCREMENT=([0-9]+))/sp; |
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
package main | |
import ( | |
"io" | |
"bytes" | |
) | |
var bom = []byte("\xef\xbb\xbf") | |
func trapBOM(rws io.ReadWriteSeeker) error { |
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 re | |
from collections import Counter | |
def term_frequency_featurization(texts): | |
for text in texts: | |
words = re.findall(r'\w+', text.lower()) | |
yield dict(Counter(words)) | |
def main(): |
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, {useMemo} from 'react'; | |
const GaugeDefaults = { | |
centerX: 50, | |
centerY: 50, | |
}; | |
/** | |
* Gets cartesian co-ordinates for a specified radius and angle (in degrees) | |
* @param cx {Number} The center x co-oriinate |