Skip to content

Instantly share code, notes, and snippets.

@sidpalas
sidpalas / maintenance-page.yaml
Last active November 30, 2023 13:26
Kubernetes temporary maintenance page
apiVersion: v1
kind: ConfigMap
metadata:
name: maintenance-page
data:
maintenance.html: |-
<!--HTML GOES HERE-->
<!doctype html>
<title>Site Maintenance</title>
<link rel="stylesheet" href="maintenance.css">
@tpai
tpai / articles.md
Last active September 6, 2017 07:27
nginx related note

前端優化

  • Server 設置:啟用 gzip 壓縮、靜態內容設置 max-age/expires 或使用 CDN、動態內容設置 cache control。(樣板參考)
  • 減少 HTTP Requests:善用 CSS Sprite 解決大量載入圖片的問題,盡量以水平排列圖片,相較於垂直排列圖片大小較小。
  • favicon.ico:存在且小於 1KB 加上較長的 expires。
  • 預載:頁面加載完成後隨即加載用於其他頁面的資源。

CORS

@vi
vi / rust_wine.md
Last active November 28, 2022 22:21
Using Rust in Wine as a sort of cross-compiler

Cross-compiling Rust from Linux to Windows using Wine

🔴 Note: this article is obsolete. This cross-compilation direction may just work out of the box. 🔴

0. Ensure Rust works on Host

Let's create a dummy project for a test.

$ cargo new test
@soarez
soarez / ca.md
Last active April 22, 2024 03:01
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@cblunt
cblunt / myapp
Last active November 26, 2016 22:57
Rails app init.d script for passenger-standalone
#!/bin/bash
### BEGIN INIT INFO
# Provides: myapp passenger in standalone
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop myapp.com web site
### END INIT INFO
#PATH=/sbin:/usr/sbin:/bin:/usr/bin
@pete-otaqui
pete-otaqui / bumpversion.sh
Created December 2, 2012 11:08
Bump a software project's VERSION, add the CHANGES, and tag with GIT
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.