Skip to content

Instantly share code, notes, and snippets.

View andycall's full-sized avatar
🎯
Still working hard on OpenWebF

Andy Dong andycall

🎯
Still working hard on OpenWebF
View GitHub Profile
@andycall
andycall / strLen.js
Created June 20, 2018 07:46 — forked from Alex1990/strLen.js
Count a string(mixing English and Chinese characters) length, and this is a rough function.
/**
* Description: Count a string (mixing English and Chinese characters) length.
* A basic and rough function.
*
* Performance:
* Multiple methods performance test on http://jsperf.com/count-string-length.
* You can see that using regexp to check range is very slow from the above test page.
*/
function strLen(str) {
if (typeof str !== 'string') {
@andycall
andycall / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.2.1 (2014-06-01)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
namespace {