Skip to content

Instantly share code, notes, and snippets.

Simon Asika asika32764

Block or report user

Report or block asika32764

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View categories-query-benchmark.php
<?php
// Origin
// -----------------------------------------------------------------------------------------
$rootCategory = $this->getRootCategory();
$db = $this->getDbo();
$start_time = microtime(TRUE);
foreach (range(1,500) as $r):
View joomla-doctrine-driver.md

Joomla Doctrine Adapter

Get Dbo & Doctrine

Origin database can work since it is just an adapter.

$db = JFactory::getDbo();

$db->setQuery($query)->execute();
View js-example.js
// Example JS
var RxresidentList = {
/**
*
*/
init : function(option, $)
{
this.root = option.root || 'http://localhost';
View ReadmeGoogleCloudStorage.md

The Google Cloud Storage Package

Using the Google Cloud Storage Package

The Google Cloud Storage package is designed to be a straightforward interface for working with Google Cloud Storage. It is based on version 2.0 of the Google Cloud Storage XML API. You can find documentation on the API at https://developers.google.com/storage/docs/xml-api-overview.

Google Cloud Storage is built upon the Http package which provides an easy way to consume URLs and web services in a transport independent way.

Instantiating Google Cloud Storage

View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
View OverloadGetter & Setter.js
Function.prototype.overloadSetter = function(usePlural)
{
var self = this;
return function(a, b)
{
if (a == null)
{
return this;
}
@asika32764
asika32764 / Simple-JS-Template-Engine.js
Last active Aug 29, 2015
If we use `parseVariable('Hi {{name}}~~~', {name: Simon})`, this function will return `Hi Simon~~~`.
View Simple-JS-Template-Engine.js
/**
* Parse variable {{name}}.
*
* Example: If we use `parseVariable('Hi {{name}}~~~', {name: 'Simon'})`, this function will return `Hi Simon~~~`.
*
* @param {string} string
* @param {Object} data
*
* @returns {string}
*/
View edit-remote.md

打開 FileZilla 設定

p-2014-07-14-1

選擇檔案編輯設定,選擇常用的編輯器,記得勾選總是使用預設編輯器

p-2014-07-14-2_071414_095132_pm

選擇你的編輯器,可以去找 DW 的執行檔

@asika32764
asika32764 / URI.js
Last active Aug 29, 2015
The simple JS URI object. Repository move to https://github.com/asika32764/SimpleURI.js
View URI.js
/*!
* The simple JS URI object.
*
* @license GNU General Public License version 2 or later; see LICENSE
* @link https://gist.github.com/asika32764/6556efdf5c593ce140bb
*/
/**
* The simple JS URI object.
*
View ordutf8.php
<?php
function ordutf8($string, &$offset) {
$code = ord(substr($string, $offset,1));
if ($code >= 128) { //otherwise 0xxxxxxx
if ($code < 224) $bytesnumber = 2; //110xxxxx
else if ($code < 240) $bytesnumber = 3; //1110xxxx
else if ($code < 248) $bytesnumber = 4; //11110xxx
$codetemp = $code - 192 - ($bytesnumber > 2 ? 32 : 0) - ($bytesnumber > 3 ? 16 : 0);
for ($i = 2; $i <= $bytesnumber; $i++) {
You can’t perform that action at this time.