Skip to content

Instantly share code, notes, and snippets.

View brisbanewebdeveloper's full-sized avatar

Brisbane Web Developer brisbanewebdeveloper

View GitHub Profile
@brisbanewebdeveloper
brisbanewebdeveloper / .gitignore
Last active April 30, 2022 00:49
CTRL key based operation with Karabiner-Elements
.history
.vscode
save.sh
@brisbanewebdeveloper
brisbanewebdeveloper / create.sh
Created October 13, 2019 06:35
Create self-signed SSL Certificate
#!/bin/bash
openssl \
req \
-x509 \
-nodes \
-days 365 \
-newkey rsa:2048 \
-keyout $PWD/httpd-selfsigned.key \
-out $PWD/httpd-selfsigned.crt \
@brisbanewebdeveloper
brisbanewebdeveloper / howto.md
Last active August 3, 2019 07:00
How to limit MongoDB memory usage

If you are running MongoDB 3.2 or later version, you can limit the wiredTiger cache.

In /etc/mongod.conf add the wiredTiger part:

storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
 wiredTiger:
@brisbanewebdeveloper
brisbanewebdeveloper / functions.php
Created March 21, 2019 14:04
Include Attributes for WordPress/WooCommerce Search
/**
* Include Attributes for search
* @return array|null
*/
function getProductSearchClauses() {
/* @var WP_Query $wp_query */
global $wp_query;
global $wpdb;
@brisbanewebdeveloper
brisbanewebdeveloper / example.php
Created November 25, 2018 06:00
How to specify the image for IMG Tag depending on the browser width for Wordpress
<?php
/**
* This needs to be investigated for the case the image comes from Advanced Custom Field, Toolset, Featured Image etc.
*
* This example shows the actual image used on the browser depends on "sizes" attribute
* even though each IMG Tag refers different image file at "src" attribute.
*
* Wordpress creates three thumbnails from the original image when we upload it via Media Library.
* If the image width is smaller than the three sizes, it creates only the ones smaller than the image
* (e.g. If the image has 700px width, only two thumbnails (150px and 300px) are created).
@brisbanewebdeveloper
brisbanewebdeveloper / docker-compose.yml
Created April 16, 2018 06:45
Docker with Kali Linux
# https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
# https://docs.docker.com/compose/compose-file/
#
# [ How to delete Dangling Images (which are layers that have no relationship to any tagged images) ]
# docker rmi $(docker images -f dangling=true -q)
#
# [How to login the container]
# docker run -t -i kali_kali /bin/bash
#
# [About Metasploit]
@brisbanewebdeveloper
brisbanewebdeveloper / docker-compose.yml
Last active August 18, 2017 12:48
Docker Compose File
# https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
# https://docs.docker.com/compose/compose-file/
version: "3"
services:
web:
image: nginx:latest
ports:
#- "8080:80"
- "8080:8080"
restart: always
@brisbanewebdeveloper
brisbanewebdeveloper / telstra.service.status.user.js
Last active November 4, 2015 09:43
Enters your postcode automatically at Telstra Service Status page
// ==UserScript==
// @name Enter postcode at Telstra Site
// @namespace http://your.homepage/
// @version 0.1
// @description Enter your postcode automatically at Telstra Service Status page
// @author Hiro Nozu
// @match http://servicestatus.telstra.com/
// @grant none
// ==/UserScript==
@brisbanewebdeveloper
brisbanewebdeveloper / _pushover-workflow-mac.md
Last active September 18, 2015 08:34
How to send a notification to Mac OSX computer from iOS device via Workflow and Pushover
@brisbanewebdeveloper
brisbanewebdeveloper / get-sar.php
Last active August 29, 2015 14:24
Get percentage of time that the CPU was idle from sar command as JavaScript variable
<?php
/**
* Place this PHP script somewhere accessible via HTTP, amend it for your situation if necessary
*
* Example Usage with jQuery
* $.getScript(
* 'http://my-site.com/get-sar.php',
* function() {
* // You can use something like http://www.chartjs.org/ to display the data as chart