Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View asika32764's full-sized avatar

Simon Asika asika32764

View GitHub Profile
<?php
// Origin
// -----------------------------------------------------------------------------------------
$rootCategory = $this->getRootCategory();
$db = $this->getDbo();
$start_time = microtime(TRUE);
foreach (range(1,500) as $r):

Joomla Doctrine Adapter

Get Dbo & Doctrine

Origin database can work since it is just an adapter.

$db = JFactory::getDbo();

$db-&gt;setQuery($query)-&gt;execute();
// Example JS
var RxresidentList = {
/**
*
*/
init : function(option, $)
{
this.root = option.root || 'http://localhost';

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

@asika32764
asika32764 / uri.js
Created June 6, 2014 18:48 — forked from jlong/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"
@asika32764
asika32764 / OverloadGetter & Setter.js
Created June 7, 2014 17:05
OverloadGetter & Setter
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 August 29, 2015 14:02
If we use `parseVariable('Hi {{name}}~~~', {name: Simon})`, this function will return `Hi Simon~~~`.
/**
* 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}
*/

打開 FileZilla 設定

p-2014-07-14-1

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

p-2014-07-14-2_071414_095132_pm

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

@asika32764
asika32764 / URI.js
Last active August 29, 2015 14:04
The simple JS URI object. Repository move to https://github.com/asika32764/SimpleURI.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.
*
<?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++) {