Skip to content

Instantly share code, notes, and snippets.

View asika32764's full-sized avatar

Simon Asika asika32764

View GitHub Profile
@asika32764
asika32764 / 0-register-ssh-protocol.md
Last active September 9, 2022 18:24
Register ssh URL link protocol (ssh://) in Windows

Register ssh URL link (protocol) in Windows

Download register-ssh-protocol.reg and double click to install it.

You can change the position of open-ssh-protocol.js before install.

Then, download the open-ssh-protocol.js file to C:\bin\.

You can also change the terminal app path as you want.

@asika32764
asika32764 / utilities-php-package-by-asika.md
Last active August 5, 2022 02:01
Simon Asika 開發的實用工具列表

Simon Asika 開發的實用工具列表

Web Service

CC0 Avatar Placeholder

http://pravatar.cc/


@asika32764
asika32764 / print_r_level.php
Last active August 5, 2022 01:55
Useful recursive dumping function to simulate `print_r()` but limited by level.
<?php
/**
* @copyright Copyright (C) 2011 - 2014 SMS Taiwan, Inc. All rights reserved.
* @license GNU General Public License version 2 or later;
*/
/**
* Recursive print variables and limit by level.
*
* @param mixed $data The variable you want to dump.
@asika32764
asika32764 / preg_replace_test.php
Created June 29, 2022 19:00 — forked from eduardomello/preg_replace_test.php
use of PHP preg_replace() to add basepath to src and href
<?php
/*
* Script that shows how to insert a basepath on HTML tags
* It looks for link, script and img tags that do not contain the
* determined basepath or a external URL
*/
// BasePath to insert in string when necessarry
$basePath = "/project/site/";
$escapedBasePath = str_replace("/", "\/", $basePath);
<?php
/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Data;
use Psr\Cache\CacheInterface;
@asika32764
asika32764 / php-class-to-read-psd-files
Created March 11, 2022 16:17 — forked from devluis/php-class-to-read-psd-files
PHP class to read PSD files
<?
/* This file is released under the GPL, any version you like
*
* PHP PSD reader class, v1.3
*
* By Tim de Koning
*
* Kingsquare Information Services, 22 jan 2007
*
* example use:
Vue.directive('calendar', {
inserted(el, binding) {
// :v-calendar="{ format: 'YYYY-MM-DD HH:mm:ss' }"
const options = Object.assign({
// Some default options
// Use FontAwesome icons
icons:{
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
@asika32764
asika32764 / phpos-possible-values.md
Created August 16, 2014 06:18
PHP_OS possible values

Some possible values for PHP predefined constant PHP_OS:

  • CYGWIN_NT-5.1
  • Darwin
  • FreeBSD
  • HP-UX
  • IRIX64
  • Linux
  • NetBSD
  • OpenBSD
@asika32764
asika32764 / mysql.sock.sh
Last active January 28, 2021 21:23
Using this command to create a symbol link to mysql.sock in Mac
# XAMPP
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock
# MAMP
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
# AMPPS
sudo ln -s /Applications/AMPPS/mysql/tmp/mysql.sock /var/mysql/mysql.sock