Skip to content

Instantly share code, notes, and snippets.

View yujiangshui's full-sized avatar
🎯
Focusing

Harry Yu yujiangshui

🎯
Focusing
View GitHub Profile
@tjx666
tjx666 / cloudSettings
Last active December 25, 2023 01:56
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-02-14T06:16:33.865Z","extensionVersion":"v3.4.3"}
@roylez
roylez / backup-db.sh
Created August 22, 2017 22:23
dokku postgres backupscript
#! /bin/bash
#
# to restore:
# gunzip XXX.db.gz
# dokku postgres:import <dbname> < XXX.db
# directory to save backups in, must be rwx by postgres user
BASE_DIR="/var/backups/postgres"
YMD=$(date "+%Y-%m-%d")
DIR="$BASE_DIR"
@Ron3
Ron3 / History|-104b39d1|entries.json
Last active May 21, 2022 09:59
AWS Lambda初触
{"version":1,"resource":"file:///Users/ron/Documents/Work/Github/WastedLand_Unity/Assets/Code/BPGames/BPMono/BPMainController.cs","entries":[{"id":"asRE.cs","timestamp":1653017452369},{"id":"1N1A.cs","timestamp":1653017490920},{"id":"ZcIB.cs","timestamp":1653017517999},{"id":"1sWI.cs","timestamp":1653018848615},{"id":"b2y6.cs","timestamp":1653033123307},{"id":"p0fY.cs","timestamp":1653033276547},{"id":"SurA.cs","timestamp":1653033301622},{"id":"8aiu.cs","timestamp":1653033472606},{"id":"4qe9.cs","timestamp":1653038794506},{"id":"m05x.cs","timestamp":1653038809996},{"id":"8dkr.cs","timestamp":1653038832762},{"id":"xxRB.cs","timestamp":1653039127616},{"id":"1IX0.cs","timestamp":1653040123957}]}
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4

Comparison of Typescript and Flow

Common Features

  • Lots of type inference

  • Null/undefined checking

Similar syntax
@joshma
joshma / WhyDidYouUpdateMixin.js
Last active May 9, 2018 06:17
Performance Engineering with React (Part 2)
/* eslint-disable no-console */
import _ from 'underscore';
/*
Drop this mixin into a component that wastes time according to Perf.getWastedTime() to find
out what state/props should be preserved. Once it says "Update avoidable!" for {state, props},
you should be able to drop in React.addons.PureRenderMixin
React.createClass {
mixins: [WhyDidYouUpdateMixin]
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@ericmdev
ericmdev / docker-remove-all.sh
Last active October 20, 2021 09:15 — forked from JeffBelback/docker-destroy-all.sh
Docker - stop and remove all containers and images.
#!/bin/bash
# Stop all containers.
docker stop $(docker ps -a -q)
# Delete all containers.
docker rm $(docker ps -a -q)
# Delete all images.
docker rmi --force $(docker images -q)
@wesbos
wesbos / tab-trigger.js
Created November 16, 2015 19:33
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@branneman
branneman / detects-flexbox.js
Last active May 12, 2016 09:14
Feature detect Flexbox support with JavaScript
define(function() {
var cssomPrefixes = 'Moz O ms Webkit'.split(' ');
var modElem = {
elem: document.createElement('modernizr')
};
var mStyle = {
style: modElem.elem.style
};