Skip to content

Instantly share code, notes, and snippets.

@siygle
siygle / Dockerfile
Last active January 25, 2023 10:45
Setup verdaccio on dokku
FROM node:8.6.0-alpine
LABEL maintainer="https://github.com/verdaccio/verdaccio"
RUN apk --no-cache add openssl && \
wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 && \
chmod +x /usr/local/bin/dumb-init
# If you want "dokku enter" don't forget install bash
# https://github.com/dokku/dokku/issues/2572
RUN apk update && \
@siygle
siygle / Dockerfile
Created March 13, 2021 09:29
local dev mongodb transaction
FROM node:14
WORKDIR /usr/src/app
ARG NPM_TOKEN
COPY .npmrc .npmrc
COPY package*.json ./
RUN npm install
COPY . .
@siygle
siygle / google-cloud-storage.js
Created September 22, 2013 18:31
[Sample] Upload image to google cloud storage
var GAPI = require('node-gcs').gapitoken;
var GCS = require('node-gcs');
var fs = require('fs');
var path = require('path');
var format = require('util').format;
var config = require('../res/config.js').GCS;
const STATIC_URL = "https://storage.googleapis.com";
const BUCKET = config.BUCKET_NAME;
const FILENAME = "rock-cloud.png";
@siygle
siygle / wordpress-blog-latest.md
Last active September 10, 2022 03:00
wordpress-blog-latest.md

網路黑手的呢喃 Lastest Articles 👇 網路黑手的呢喃 #19 元宇宙的世界,真的還沒到… 網路黑手的呢喃 #18 OpenJS World 2022 速記 網路黑手的呢喃 #17 【推薦】Big Timber(台譯:終極伐木達人) 最近掉進樂高的坑 網路黑手的呢喃 #16

@siygle
siygle / my.goggles
Created June 30, 2022 13:40
my brave goggles
! name: No Pixnet
! description: Rerank results to remove pages / threads hosted on Pixnet.
! public: true
! author: siygle
$discard,site=pixnet.net
@siygle
siygle / gist:9678772
Created March 21, 2014 03:12
Parse Gmail Inbox to sheet
function processInboxToSheet() {
//var threads = GmailApp.getInboxThreads();
// Have to get data separate to avoid google app script limit!
var start = 0;
var threads = GmailApp.getInboxThreads(start, 100);
var sheet = SpreadsheetApp.getActiveSheet();
var result = [];
for (var i = 0; i < threads.length; i++) {
var messages = threads[i].getMessages();
@siygle
siygle / gist:9533495
Created March 13, 2014 18:01
spawnSync example
var sync = require('child_process').spawnSync;
console.log('start ls');
var ls = sync('ls', ['-lh', '/usr']);
console.log('end ls');
console.log('start grep');
var grep = sync('grep', ['local'], {
input: ls.stdout
})
@siygle
siygle / parse-csv-email.js
Created January 23, 2018 13:01
Parse CSV, filter and then output to another file (e.g, Email)
const parse = require('csv-parse')
const fs = require('fs')
const transform = require('stream-transform')
const isEmail = require('is-email')
const input = fs.createReadStream('./input.csv')
const output = fs.createWriteStream('./output.csv')
const parser = parse({ delimiter: ',' })
const transformer = transform((record, callback) => {

Keybase proof

I hereby claim:

  • I am ferrari on github.
  • I am ferrari (https://keybase.io/ferrari) on keybase.
  • I have a public key ASBECMk7tyvqoMc-kTTSRhCbMCWsfXFUez0GIyih3-boxAo

To claim this, I am signing this object:

@siygle
siygle / hyper.js
Last active January 17, 2018 04:07 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows (Use bash)
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',