Skip to content

Instantly share code, notes, and snippets.

View mystix's full-sized avatar

Marc mystix

  • Singapore
View GitHub Profile
@mystix
mystix / instructions.md
Created October 25, 2022 17:11 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@mystix
mystix / serverCodes.md
Created September 6, 2022 12:42 — forked from sgnl/serverCodes.md
status codes

1xx: Information

Code Message Description
100 Continue The server has received the request headers, and the client should proceed to send the request body
101 Switching Protocols The requester has asked the server to switch protocols
103 Checkpoint Used in the resumable requests proposal to resume aborted PUT or POST requests

2xx: Successful

Code Message Description
@mystix
mystix / output-color.sh
Created September 2, 2022 08:53 — forked from WestleyK/output-color.sh
printf color output
#!/bin/bash
#
# Created by: Westley K
# Date: Aug 14, 2018
#
# run this in your terminal, and
# you will get nice colors and effects!
#
@mystix
mystix / logger.php
Last active June 19, 2021 16:04
Magento 2: Quick and dirty Loggers
<?php
// https://magento.stackexchange.com/a/92441
// method 1 (< M2.3.5)
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
// https://magento.stackexchange.com/a/320261
@mystix
mystix / 10-run-this.ps1
Last active January 6, 2024 13:53
Setup new Windows 10 machine
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/mystix/4813520f34737d77e2f266cb8af40503/raw/20-setup-windows.ps1'))
@mystix
mystix / Xero-ClientCredentials-Workaround-2020
Created August 27, 2020 07:19 — forked from channeladam/Xero-ClientCredentials-Workaround-2020
Xero client_credentials workaround - January 2020
Here is a workaround for the lack of a client credentials flow in Xero's OAuth 2.0 / OpenID Connect implementation.
From Xero's FAQ: https://developer.xero.com/faq/all/oauth-private
"Is there an equivalent of two-legged private apps in OAuth 2.0?
No, all users will follow the same OAuth 2.0 code flow.
Once you have an access token and refresh token you can refresh indefinitely or until the token is revoked by the user."
Workaround:
1. Login to Xero as the Xero user to use for the machine-to-machine flow workaround.
@mystix
mystix / sphp.sh
Last active April 30, 2019 07:54 — forked from rhukster/sphp.sh
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3")
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
php_installed_array=()
php_version="php@$1"
@mystix
mystix / mysql2-mojave.md
Created April 15, 2019 06:50 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@mystix
mystix / countdown.sh
Last active January 23, 2019 01:26 — forked from krohne/countdown.sh
Countdown timer in bash shell script
#!/bin/bash
# $1 = # of seconds
# $@ = What to print after "Waiting n seconds"
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
printf "\r\033[KWaiting %.d seconds $msg" $((secs--))
@mystix
mystix / cron.sh
Created March 31, 2018 04:50
[OSX] Cron + zsh + rbenv
*/15 * * * * $(which zsh) -lc 'export PATH=/usr/local/bin:/usr/local/sbin:$PATH; eval "$(rbenv init -)"; ruby SOME_SCRIPT.rb'