Skip to content

Instantly share code, notes, and snippets.

View zackexplosion's full-sized avatar
🏠
Working from home

Zack zackexplosion

🏠
Working from home
View GitHub Profile
@zackexplosion
zackexplosion / circle-animation.markdown
Created October 31, 2024 14:50
Circle Animation🤔
@zackexplosion
zackexplosion / clock.js
Created July 9, 2024 06:45
Clock with milliseconds
class Здравствуй {
constructor(){
const d1 = new Date()
const d2 = new Date().getTime().toString()
const output = `\r ${d1} ${d2}`
process.stdout.write(output)
setTimeout(function(){
new Здравствуй()
@zackexplosion
zackexplosion / b.js
Created May 23, 2024 15:25
裝B攤平法
var obj = {
"name" : {
full_name: 'Hello',
given: ['a name', 'b name', 'c name']
},
"tel" : {
phone: '0000000',
mobile: '+886 11111111'
},
"address" : '天龍區'
const app = {
name: 'solar-watcher-client',
script: './index.js',
env: {
CLIENT_ID: 'J=_pxGn4m5W4(=v',
CLIENT_LOGGER_URL: 'http://solar-data.zackexplosion.fun',
CLIENT_SERIAL_PORT_PATH: '/dev/serial/by-id/usb-FTDI_FT231X_USB_UART_D309Q80Z-if00-port0',
},
}
@zackexplosion
zackexplosion / deploy.sh
Created November 16, 2021 01:54
docker build and deploy to nas
IMAGE_NAME=your-image-name
[email protected]
ARCHIVE_FILE_NAME=archive.tar
REMOTE_PATH=/a/remote/path
REMOTE_PORT=22
PORTMAP=1111:1111
rm $ARCHIVE_FILE_NAME
docker rmi $IMAGE_NAME
docker build . -t $IMAGE_NAME
@zackexplosion
zackexplosion / yolo.js
Last active October 14, 2021 11:22
藍新後台出貨單下載
// make sure you have been login to https://www.newebpay.com/sale/Sell_center/search_transaction
// copy and paste this snippit to web dev console
// exportToCsv credit
// https://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side
function exportToCsv(filename, rows) {
var processRow = function (row) {
var finalVal = '';
for (var j = 0; j < row.length; j++) {
var innerValue = row[j] === null ? '' : row[j].toString();
@zackexplosion
zackexplosion / .markdown
Created August 1, 2020 19:02
抽獎機率設定
const moment = require('moment')
const ecpay_payment = require('ecpay-payment')
function getAddress (invoice) {
if (invoice.string_address) {
return invoice.string_address
}
var address = ''
try {
2015-01-03 05:41:08 中和-土城
2015-01-03 05:43:56 土城-樹林
2015-01-03 05:47:56 三鶯-鶯歌系統
2015-01-03 05:49:38 鶯歌系統-大溪
2015-01-03 05:53:53 大溪-龍潭
2015-01-03 05:56:28 龍潭-關西服務區
2015-01-03 06:00:47 關西服務區-關西
2015-01-03 06:03:56 關西-竹林
2015-01-03 06:09:47 竹林-寶山
2015-01-03 06:11:34 寶山-新竹系統