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
""" | |
Usage: | |
Make sure that redis is running on localhost (or adjust the url) | |
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html | |
pip install -u uvicorn | |
Install dependencies |
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
wget https://golang.org/dl/go1.15.linux-amd64.tar.gz | |
tar -zxvf go1.15.linux-amd64.tar.gz | |
mkdir gopath | |
cat <<'EOT' >> .profile | |
export GOROOT=$HOME/go | |
export GOPATH=$HOME/gopath | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH |
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
ffmpeg -i input.mov -vf fps=15,scale=600:-1:flags=lanczos,palettegen palette.png | |
ffmpeg -i input.mov -i palette.png -filter_complex "\ | |
fps=15,scale=600:-1:flags=lanczos[x];\ | |
[x][1:v]paletteuse output.gif |
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
// response: Response. import 'isomorphic-fetch'; | |
// map: import { map } from 'rxjs/operators'; | |
const bodyMap = <T>() => map<T, FormattedResponse<T>>((body: T) => ({ response, body })); | |
return from(response.arrayBuffer()).pipe(bodyMap<ArrayBuffer>()); |
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
<!-- Reference: https://github.com/developit/preact-without-babel/ --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<style> | |
#header { | |
opacity: 1; | |
transition: opacity 1s; | |
} |
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
git remote add [name-of-the-remote] [https-repository-url] | |
git remote set-url [name-of-the-remote] [ssh-repository-url] # avoid enter password every push | |
git push [name-of-the-remote] [name-of-the-local-branch]:[name-of-the-remote-branch] | |
Reference: | |
https://stackoverflow.com/a/6565661 | |
https://stackoverflow.com/a/13897766 |
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
# Set the name and the supported language of the project | |
PROJECT(hello-world C) | |
# Set the minimum version of cmake required to build this project | |
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | |
# Use the package PkgConfig to detect GTK+ headers/library files | |
FIND_PACKAGE(PkgConfig REQUIRED) | |
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0) | |
# Setup CMake to use GTK+, tell the compiler where to look for headers |
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
{ | |
"jsxBracketSameLine": true, | |
"quoteProps": "consistent" | |
} |
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, { Component, Fragment } from 'react' | |
import firebase from 'firebase/app' | |
import 'firebase/auth' | |
import './style.css' | |
// TODO: whitelist the domain in the API manager: | |
// https://plus.google.com/u/0/+MichaelPrentice/posts/7T65U83ncfT?sfc=true | |
// "This is found in https://console.cloud.google.com under API Manager -> Credentials -> Browser Key -> Key | |
// Restrictions. Of course you have to select an active project before performing this navigation." |
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
<html> | |
<header> | |
<title>firestore realtime vanillajs</title> | |
</header> | |
<body> | |
<h1>new message</h1> | |
<div id="messages"></div> |