Skip to content

Instantly share code, notes, and snippets.

View genffy's full-sized avatar
♥️
peace

Zhengfei Li genffy

♥️
peace
View GitHub Profile
@mkornatz
mkornatz / cf-worker.js
Last active May 4, 2024 04:07
Cloudflare Workers CORS Proxy (supports websockets)
// We support the GET, POST, HEAD, and OPTIONS methods from any origin,
// and allow any header on requests. These headers must be present
// on all responses to all CORS preflight requests. In practice, this means
// all responses to OPTIONS requests.
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS",
"Access-Control-Max-Age": "86400",
}
@clodal
clodal / ec2-node-app.md
Last active April 6, 2024 18:31
How to deploy NodeJS App to EC2

How to deploy NodeJS App to EC2

Instructions

  1. Connect to ec2 via ssh
  2. Install nvm: https://github.com/nvm-sh/nvm via curl e.g. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
  3. Source nvm: . ~/.nvm/nvm.sh
  4. Install node: nvm install <your_version>
  5. Install git: sudo yum install -y git
  6. Git clone your project and cd in
  7. Install yarn: npm i -g yarn
@almccon
almccon / .block
Last active July 24, 2023 11:34
Mapbox routing demo (modified)
license: mit
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 22, 2024 02:05
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@bnoordhuis
bnoordhuis / http-and-https-proxy.js
Created February 8, 2013 16:31
A node.js proxy that accepts HTTP and HTTPS traffic on the same port.
var fs = require('fs');
var net = require('net');
var http = require('http');
var https = require('https');
var httpAddress = '/path/to/http.sock';
var httpsAddress = '/path/to/https.sock';
fs.unlinkSync(httpAddress);
fs.unlinkSync(httpsAddress);