Know more about me on https://yeslee.me !
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"; | |
const aws = require("aws-sdk"); | |
const jimp = require("jimp"); | |
const s3 = new aws.S3( | |
process.env.ENV === "production" | |
? { | |
apiVersion: "2006-03-01", | |
} | |
: { | |
apiVersion: "2006-03-01", |
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 { createWorker } = require("tesseract.js"); | |
const fs = require("fs"); | |
const path = require("path"); | |
const worker = createWorker(); | |
const log = console.log; | |
(async () => { | |
await worker.load(); | |
await worker.loadLanguage("eng"); |
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
server { | |
listen 3003; | |
server_name localhost; | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' $http_origin; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, Cache-Control, Cookie, If-Modified-Since, Range, User-Agent, X-Requested-With'; |
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 chalk = require("chalk"); | |
const readlineSync = require("readline-sync"); | |
const puppeteer = require("puppeteer"); | |
const log = console.log; | |
const itinerary = { | |
date: "109-02-28", | |
nodes: ["塔塔加登山口", "玉山前峰", "塔塔加登山口"], | |
}; | |
const applicant = { |
- What is CSS BEM?
Haven't used BEM before, but as I know, it's a class name naming convension, for better managing css code.
- What is the difference between em and rem units?
em
: Representing relativefont-size
, relative to parent element.rem
:root em
, representing relativefont-size
, but only relative to root element (``).
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
#!/bin/bash | |
# Install wget and jq if you don't have it. | |
# Mac: brew install jq wget | |
# Linux: TBD | |
mkdir tzdb | |
cd tzdb | |
wget https://www.iana.org/time-zones/repository/tzcode-latest.tar.gz | |
wget https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz | |
gzip -dc tzcode-latest.tar.gz | tar -xf - | |
gzip -dc tzdata-latest.tar.gz | tar -xf - |
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
token="my_personal_access_token" | |
base_url="https://api.github.com" | |
list_branches_url="/repos/hiiamyes/github-api-test/branches" | |
list_commites_url="/repos/hiiamyes/github-api-test/commits" | |
list_tags_url="/repos/emq-inc/emq-adminsite/tags" | |
headers="Authorization: token $token" | |
commit_sha=$( | |
curl \ | |
--silent $base_url$list_branches_url/sprint \ | |
-H "$headers" | |
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
# brew install jq | |
#!/bin/sh | |
commit_sha=$(curl -s "https://api.github.com/repos/hiiamyes/repo/branches/develop" \ | |
-H 'Authorization: token {token}' | | |
jq -r '.commit.sha') | |
tag_name=$(curl -s "https://api.github.com/repos/hiiamyes/repo/tags" \ | |
-H 'Authorization: token {token}' | | |
jq -r --arg commit_sha $commit_sha '.[] | select(.commit.sha == $commit_sha) | .name') | |
build_number=${tag_name/build-/} | |
build_number=${build_number/.1/} |
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 axios = require("axios"); | |
(async () => { | |
const assignee = "yes", | |
username = "", | |
password = ""; | |
const res = await axios.request({ | |
url: "https://emq-inc.atlassian.net/rest/api/3/search", | |
method: "post", |
NewerOlder