Skip to content

Instantly share code, notes, and snippets.

View asika32764's full-sized avatar

Simon Asika asika32764

View GitHub Profile
@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/


use Windwalker\Uri\Uri;
/**
* The AsyncRequest class.
*
* @since {DEPLOY_VERSION}
*/
class AsyncRequest
{
/**
function AjaxHelper() {
this.ajax = function(url, type, dataType, data, callback) {
$.ajax({
url: url,
type: type,
dataType: dataType,
data: data,
success: callback,
error: function(xhr, errorType, error) {
alert('Ajax request error, errorType: ' + errorType + ', error: ' + error)
@asika32764
asika32764 / auto-deploy.md
Created July 6, 2016 06:49 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@asika32764
asika32764 / spinner.rb
Created June 24, 2016 01:01 — forked from ellemenno/spinner.rb
ascii spinner
#!/usr/bin/env ruby
# encoding: UTF-8
@dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷']
#braille random: 0x2800 - 0x28ff
@z_arrow = ['←','↖','↑','↗','→','↘','↓','↙']
@z_b = ['b','ᓂ','q','ᓄ']
@z_d = ['d','ᓇ','p','ᓀ']
<?php
/**
* Part of ihealth project.
*
* @copyright Copyright (C) 2011 - 2014 SMS Taiwan, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
use Windwalker\Data\Data;
@asika32764
asika32764 / README.md
Last active April 30, 2017 14:11
DataMapper with Entity

p-2016-05-23-006

p-2016-05-23-005

p-2016-05-23-004

<?php
ini_set('display_errors', true); error_reporting(-1); // <- for debugging purposes only
$socket=socket_create(AF_INET, SOCK_RAW, SOL_TCP);
if ( !$socket ) {
$errno = socket_last_error();
$error = sprintf('%s (%d)', socket_strerror($errno), $errno);
trigger_error($error, E_USER_ERROR);
}
<?php
include("./php-AES.php");
$z = "abcdefgh01234567"; // 128-bit key
//$z = "abcdefghijkl012345678901"; // 192-bit key
//$z = "abcdefghijuklmno0123456789012345"; // 256-bit key
$aes = new AES($z);
$data = file_get_contents("./example.txt");
<?php
// components/com_flower/model/sakura.php
// Model
class FlowerModelSakura extends \Windwalker\Model\CrudModel
{
// CrudModel will auto getForm()
}
// Then add components/com_flower/model/form/sakura.xml