Skip to content

Instantly share code, notes, and snippets.

View calvinlam0124's full-sized avatar

Calvin Lam calvinlam0124

  • Hong Kong
View GitHub Profile
@calvinlam0124
calvinlam0124 / docker-compose.pgsql.yml
Last active January 4, 2020 15:27
docker, docker-compose, MySQL, phpMyAdmin, adminer
version: '3.1'
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: example
@calvinlam0124
calvinlam0124 / fbevents.js
Created January 1, 2020 09:47 — forked from sunderls/fbevents.js
facebook pixel js prettified
/*1482118385,,JIT Construction: v2746767,en_US*/
/**
* Copyright Facebook Inc.
*
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
try {
(function(win, doc, location, history) {
'use strict';
@calvinlam0124
calvinlam0124 / .circleci-config.yml
Created December 27, 2019 18:26
Laravel circleci sample
version: 2
jobs:
build:
working_directory: /var/www/html
docker:
- image: php:7.3.5-apache
environment:
- APP_ENV=testing
- APP_KEY=base64:xxx+xxx=
@calvinlam0124
calvinlam0124 / Base64ImageTransformer.php
Last active December 27, 2019 18:28
Laravel Middleware
<?php
namespace App\Http\Middleware;
use App\Helpers\Base64Image;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\File\UploadedFile;
<?php
// Class extends Migration
use Illuminate\Support\Facades\Schema;
// add fields
Schema::create('video_channel_keywords', function (Blueprint $table) {
// $table->bigIncrements('id');
});
@calvinlam0124
calvinlam0124 / wget.sh
Created November 29, 2018 08:50
wget lorempixel 50 times
#!/bin/bash
for i in {1..50}
do
echo "Welcome $i times"
wget -O $i.jpg http://lorempixel.com/300/300
done
@calvinlam0124
calvinlam0124 / gist:527925159bbda779771f861c7be2002f
Created October 2, 2018 11:14 — forked from Ricardo-Diaz/gist:3956079
CSS: Reset all colors and Link Color
Reset all colors and change link color
This resets all text and background colors so you’re back at square one with black text. Then it changes the color and style of links to distinguish from regular text and make them apparent that they’re links – change the color and styling to whatever you want.
* {
color: black !important;
background-color: white !important;
background-image: none !important;
}
a:link {
#!/usr/bin/env python3
import unittest
import sys
from TestAPI import TestAPI
# run TestAPI
suite = unittest.TestLoader().loadTestsFromTestCase(TestAPI)
re = unittest.TextTestRunner(verbosity=2).run(suite)
server {
listen 80; ## listen for ipv4; this line is default and implied
server_name munin.example.com;
location / {
alias /var/cache/munin/www/;
}
location ^~ /munin-cgi/munin-cgi-graph/ {