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 / test.js
Last active November 1, 2018 01:00
test
describe('This is a Test', () => {
it('test suit one', () => {
expect(1 + 1).toBe(2);
});
it('test suit two', () => {
expect(2 + 2).toBe(4);
});
});
@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 / new_gist_file_0
Created June 14, 2015 10:23
pure js file upload with progress
var _submit = document.getElementById('_submit'),
_file = document.getElementById('_file'),
_progress = document.getElementById('_progress');
var upload = function(){
if(_file.files.length === 0){
return;
}
@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 {