Skip to content

Instantly share code, notes, and snippets.

View rocwang's full-sized avatar

Roc Wong rocwang

View GitHub Profile

How to create a trusted local SSL certificate

Slate v1.0 uses a local express server and serve most of your assets from https://localhost:8080. It's a good idea to create a trusted SSL certificate on your device so localhost assets served via https are never blocked.

ⓘ The below steps probably only work in MacOS.

  1. Copy and paste the command below into your terminal to navigate to your home directory, create a folder called .localhost_ssl, and then navigate to that folder:
cd && mkdir .localhost_ssl && cd .localhost_ssl
@rocwang
rocwang / wallpaper.shell
Last active October 1, 2018 08:30
Update wallpaper from Interfacelift for Linux
#!/bin/bash
################################################################################
# Wallpaper Updater #
# #
# Automatically update wallpaper from "interfacelift.com". Only for GNOME2 #
# #
# --Roc 2008-03-18 #
################################################################################
RSS_FILE=`tempfile`
@rocwang
rocwang / create-db.sql
Created April 27, 2016 22:42
Create database with UTF*
CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
@rocwang
rocwang / docker-clean.sh
Last active December 22, 2022 02:22
Remove all Docker containers and unused images and volumes
#!/bin/bash
#Remove all Docker containers and unused images and volumes
docker ps -qa|xargs docker rm -f
docker images |grep '<none>'|awk '{print $3}'|xargs docker rmi
docker volume ls -qf dangling=true|xargs docker volume rm
@rocwang
rocwang / generate.sh
Last active November 28, 2015 09:08
Generate HTML snippet for Photoswipe by using "identify"
identify -format '<div class="gallery__col js-gallery__col">\n<a href="img/prev-conf/%f" class="gallery__link js-gallery__link" data-width="%w" data-height="%h">\n<img src="img/prev-conf/%f" alt="Previous Conference" class="gallery__img js-gallery__img">\n</a>\n</div>\n\n' *
@rocwang
rocwang / magento-email-test.php
Created September 9, 2015 05:00
Magento email test script.
<?php
require_once '../abstract.php';
class MR_Emailtest extends Mage_Shell_Abstract
{
/**
* Retrieve Usage Help Message
*
* @return string
*/