Skip to content

Instantly share code, notes, and snippets.

View WeiChiaChang's full-sized avatar
🐻
How bear you

WesleyZen WeiChiaChang

🐻
How bear you
  • Planet Earth
  • Tainan, Taiwan
View GitHub Profile
@WeiChiaChang
WeiChiaChang / progress.html
Created July 26, 2017 10:08
Simple Pure CSS Progress Bar
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta chatset="UTF-8" />
<title>CSS Progress Bar</title>
<style>
.wrapper {
width: 500px;
}
@WeiChiaChang
WeiChiaChang / New repo from another boilerplate repo.sh
Created April 25, 2018 04:11
Create a new repo based on another remote boilerplate repo.
# Cloning the boilerplate remote repo
git clone -o [boilerplate name] [boilerplate remote repo] [new-project repo folder name]
# Enter the cloned repo folder
cd [new-project repo folder name]
# Clean the README
rm README.md && touch README.md
# If you have LICENSE, you can clean it too.
let a = 1
let b = 1
let count = 0
while (a <= 20) {
while (b <= 20) {
if (((a * 2 + b) <= 20) && a * 2 > b && a !== b) {
console.log(`發現等邊三角形 | 三邊長分別為: ${a}、${a}、${b}`)
count++
}
function isInValidTriangle (a, b, c) {
const result = !((a+b)>c) || !((b+c)>a) || !((c+a)>b) ||
!((a-b)<c) || !((b-a)<c) || !((b-c)<a) || !((c-b)<a) ||!((c-a)<b) ||
!((a-c)<b) || !(a>0) || !(b>0) || !(c>0)
return result
}
if (isInValidTriangle(a, b, c)) {
console.log ('invalid')
} else if (a===b && b===c) {
if (isValidTriangle(a, b, c)) {
if (a === b && b === c) {
console.log("是等邊三角形!")
} else if (a === b || b === c || a === c) {
console.log("是等腰三角形!")
} else {
console.log("是不等邊三角形!")
}
} else {
console.log("Invalid! (無法組成有效三角形) ")
@WeiChiaChang
WeiChiaChang / flag.js
Created February 21, 2020 05:02
Flags Name After Google Translate
var flags = [
{
"code": "Afghanistan",
"name": "Afghanistan",
"img": "https://lipis.github.io/flag-icon-css/flags/4x3/af.svg"
},
{
"code": "Aland Islands",
"name": "Aland Islands",
"img": "https://lipis.github.io/flag-icon-css/flags/4x3/ax.svg"
@WeiChiaChang
WeiChiaChang / cors-anywhere.js
Created February 13, 2020 05:06
cors-anywhere
// Reference:
// https://github.com/Rob--W/cors-anywhere
// Listen on a specific host via the HOST environment variable
var host = process.env.HOST || '0.0.0.0';
// Listen on a specific port via the PORT environment variable
var port = process.env.PORT || 8081;
var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
@WeiChiaChang
WeiChiaChang / batch-img.js
Created February 11, 2020 08:49
Batch multiple images
let imageLinks = []
const async = require('async')
let fs = require('fs')
let request = require('request')
let path = require('path')
const downloadImage = (src, dest, callback) => {
request.head(src, (err, res, body) => {
if (err) { console.log(err); return }
<template>
<div class="zoomer" ref="zoomer" @mousemove="moveBG" @mouseout="mouseOut">
<div class="img normal v-fade"
v-show="!hoverNow"
:style="{
backgroundImage: `url(${imgNormal})`
}"
></div>
<div
v-show="hoverNow"
@WeiChiaChang
WeiChiaChang / gist:c2c7e39b20df1d16a45e8fd5b5abe9fd
Created September 18, 2019 04:46 — forked from ansonparker/gist:1228449
Lossless FLV to MP4 conversion
Open command prompt (Terminal) and run:
ffmpeg -i "filename.flv" -vcodec copy -acodec copy "filename.mp4"
This will copy video track and audio track from filename.flv to filename.mp4. The operation is lossless (there is no quality loss).