Skip to content

Instantly share code, notes, and snippets.

View ciao-chung's full-sized avatar
🏠
Working from home

Ciao Chung ciao-chung

🏠
Working from home
View GitHub Profile
@matthew-harper
matthew-harper / lambda.py
Created February 18, 2020 17:24
Python AWS Lambda function to process CloudTrail Events
import json
import urllib.parse
import boto3
import io
import gzip
import re
s3 = boto3.client('s3')
sns = boto3.client('sns')
sns_arn = "arn:replace_me"
@DreaMinder
DreaMinder / A Nuxt.js VPS production deployment.md
Last active July 31, 2024 13:56
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with [email protected]. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

資訊流?

由於最近在設計大人小孩都能看的網頁,發現一個很研究的事情,有人覺得字太大,又有人覺得字太小,到底有沒有一個比較好的設計方法來設定字體大小這件事?

設計大師 EvenWu 告訴我們「網頁不是畫布,是資訊流」,但我發現這件事大家都只在乎版面,而少了我認為很重要的一點 "文字大小",事實上不管是 mac 的 Chrome、Safari、 還是 ios 都有單獨調整文字大小的設定。

macOS Chrome ( 設定 > 進階 > 網頁內容 > 字型大小 ) Mac Chrome 設定>進階>網頁內容>字型大小

iOS ( 設定 > 螢幕顯示與亮度 > 文字大小 )

@jcavat
jcavat / Dockerfile
Last active April 15, 2025 17:40
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@kottenator
kottenator / select2-flat.css
Created April 23, 2014 10:49
Select2 styles for Flat UI
/*
* Select2 v3.4.6 styles customization for Flat UI
*/
/*----------------------------------------------- Main select element ------------------------------------------------*/
.select2-container .select2-choice {
height: 41px; /* Jobsy form controls have 37px total height */
border: 2px solid #bdc3c7;
border-radius: 6px;
outline: none;
font: 15px/38px "Lato", Liberation Sans, Arial, sans-serif;
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@csusbdt
csusbdt / index.html
Created January 13, 2013 16:56
How to store JSON data into the user's Google drive storage.
<html>
<head>
<!--
In this example, I started with the 5-minute example provided by Google
on the following page:
https://developers.google.com/drive/
I modified the example code, so that I could write the following
@agnoster
agnoster / README.md
Last active March 10, 2025 15:41
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)