Skip to content

Instantly share code, notes, and snippets.

View wuliupo's full-sized avatar
🎯
Focusing: Jenkins, Vue, React

Pauli wuliupo

🎯
Focusing: Jenkins, Vue, React
View GitHub Profile
@wuliupo
wuliupo / rank-star.htm
Last active November 9, 2016 03:18
Rank Star via Angular 1
<!doctype html>
<html lang="en" ng-app="demoApp">
<head>
<meta charset="UTF-8">
<title>Rank Star</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
.glyphicon-star.orange{margin-right:3px;padding:2px;border-radius:3px;text-align:center;font-size:10px;color:#FFF;background-color:#f63;}
.glyphicon-star.gray{margin-right:3px;padding:2px;border-radius:3px;text-align:center;font-size:10px;background-color:#CCC;color:#FFF;}
.big .glyphicon-star{font-size:18px;margin:-2px 8px 0 0;}
@wuliupo
wuliupo / module-define.js
Created November 9, 2016 07:29
JavaScript modern module definition
var MyModules = (function() {
var modules = {};
return {
defineModule(name, deps, impl) {
for (var i = 0; i < deps.length; i++) {
deps[i] = modules[deps[i]];
}
modules[name] = impl.apply(impl, deps);
}, getModule(name) {
return modules[name];
@wuliupo
wuliupo / closure-var.js
Created November 9, 2016 07:30
let-var
for(var i = 1; i <= 5; i++){
setTimeout(function(){
console.log(i);
}, 10);
}
// 5, 5, 5, 5, 5
for(let i = 1; i <= 5; i++){
setTimeout(function(){
@wuliupo
wuliupo / property-extend.js
Created November 11, 2016 09:09
property extended from parent
var parentObj = {a:2};
var sunObj = Object.create( parentObj );
parentObj.a; // 2
sunObj.a; // 2
parentObj.hasOwnProperty( "a" ); // true
sunObj.hasOwnProperty( "a" ); // false
sunObj.a++; // block mode
parentObj.a; // 2
sunObj.a; // 3
sunObj.hasOwnProperty("a"); // true ???
@wuliupo
wuliupo / ellipsis.htm
Last active November 18, 2016 03:16
CSS ellipsis
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS ellipsis</title>
</head>
<style>
div {
margin: 20px auto;
border: 1px solid #CCC;
@wuliupo
wuliupo / redis.php
Created January 13, 2017 11:33
php-redis-on-windows
<?php
$host = 'test.kvstore.aliyuncs.com';
$port = 6379;
$user = 'username';
$pwd = 'password1234';
$key = 'the_stored_key';
$redis = new Redis();
if ($redis->connect($host, $port) == false) {
die($redis->getLastError());
@wuliupo
wuliupo / update-wordpress-utf8.sql
Created January 18, 2017 11:43
update wordpress database to utf8
ALTER TABLE `wp_commentmeta` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_comments` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_layerslider` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_links` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_options` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_post2tag` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_postmeta` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_posts` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_revslider_css` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `wp_revslider_layer_animations` ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
@wuliupo
wuliupo / local-www-httpd.conf
Last active January 19, 2017 08:18
ProxyPass dynamic html to Node.js by Apache
# Apache httpd config
# defined: Include conf/extra/local-www-httpd.conf;
# location: conf/extra/local-www-httpd.conf;
<VirtualHost www.test-local.com:80>
DocumentRoot D:/test-local
ServerName www.test-local.com
ServerAlias test-local.com
RewriteEngine on
@wuliupo
wuliupo / VideoUrlparser.php
Created January 26, 2017 01:52
分析优酷、土豆等视频网站的播放页面,获取视频标题、视频截图、M3U8地址以及插入页面的swf地址
<?php
/**
* VideoUrlparser
*
* @package
* @version 1.4
* @Author https://github.com/jShi-git/VideoUrlparser/blob/master/VideoUrlparser.php
*
* Usage
* require_once "VideoUrlParser.class.php";
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->