Skip to content

Instantly share code, notes, and snippets.

View ahgood's full-sized avatar

Guojun ahgood

  • Fullstack Developer
  • Halifax
View GitHub Profile
@ahgood
ahgood / tsconfig.json
Created January 20, 2023 17:34 — forked from thatisuday/tsconfig.json
A simple TypeScript configuration file to be used with Webpack.
{
"compilerOptions": {
"noImplicitAny": true,
"target": "ES5",
"module": "ES2015"
}
}
@ahgood
ahgood / bing-daily-wallpaper.sh
Last active July 14, 2022 18:45 — forked from SamanSh999/changebg.sh
A shell script to set Bing Background as wallpaper automatically on macOS(2022) (requires wget & jq)
#!/usr/bin/env bash
#
# Credit: https://gist.github.com/SamanSh999/3ee8cad2859a900b7e36e1cff4204005
#
# Instruction(macOS only):
#
# 1. Save this script to your home folder
# 2. Grant permission to script: chmod +x ~/bing-daily-wallpaper.sh
# 3. Install homebrew if you don't have it: https://brew.sh/
# 4. Install jq: brew install jq
@ahgood
ahgood / detect-available-fonts.js
Created August 17, 2021 13:37 — forked from fijiwebdesign/detect-available-fonts.js
Detect available fonts with JS
/**
* JavaScript code to detect available availability of a
* particular font in a browser using JavaScript and CSS.
*
* Author : Lalit Patel
* Website: http://www.lalit.org/lab/javascript-css-font-detect/
* License: Apache Software License 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* Version: 0.15 (21 Sep 2009)
* Changed comparision font to default from sans-default-default,
@ahgood
ahgood / msmtp.sh
Created March 11, 2019 21:15 — forked from mikesmullin/msmtp.sh
install msmtp gmail, a localhost sendmail alternative
# setup msmtp for sending out email
# as an alternative to sendmail
# i prefer this because it is easier to install and configure than sendmail
# especially when using Gmail smtp servers
sudo -i
apt-get install msmtp
ln -s /usr/bin/msmtp /usr/sbin/sendmail
touch /var/log/msmtprc && chmod 666 /var/log/msmtprc
vim /etc/msmtprc
# config options: http://msmtp.sourceforge.net/doc/msmtp.html#A-user-configuration-file
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Autocomplete as Combobox,
Input as ComboboxInput,
List as ComboboxList,
Option as ComboboxOption
} from "./Combobox";
function App({ tabIndex, navigate }) {
@ahgood
ahgood / wp-bootstrap4.1-pagination.php
Created September 17, 2018 13:13 — forked from mtx-z/wp-bootstrap4.4-pagination.php
Wordpress Bootstrap 4.1 pagination (with custom WP_Query() and global $wp_query support)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
*
* @return string
* Accepts a WP_Query instance to build pagination (for custom wp_query()),
* or nothing to use the current global $wp_query (eg: taxonomy term page)
* - Tested on WP 4.9.5
<?php
namespace App\Http\Controllers;
use App\Result;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class ExportController extends Controller
{
@ahgood
ahgood / delay.js
Created May 18, 2018 02:18 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
@ahgood
ahgood / docker-wordpress.sh
Created April 16, 2018 05:26 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb:
@ahgood
ahgood / web-performance.md
Created April 9, 2018 01:25 — forked from stevekinney/web-performance.md
Web Performance Workshop

Web Performance

Requirements

Repositories