Skip to content

Instantly share code, notes, and snippets.

@gary-liguoliang
gary-liguoliang / select.jsx
Created April 4, 2017 15:13 — forked from jbottigliero/select.jsx
React <select> Component (JSX)
/** @jsx React.DOM */
define(['reactjs'], function(React){
return React.createClass({
getDefaultProps: function(){
return {
multiple: false
/*
name: 'mySelect'
@gary-liguoliang
gary-liguoliang / auto_publish_to_news_dbanotes_net.py
Last active April 2, 2017 14:03
news.dbanotes.net自动发布脚本
# -*- coding: utf-8 -*-
import requests
from BeautifulSoup import BeautifulSoup
def get_fnid_from_html(html):
soup = BeautifulSoup(html)
return soup.find("form").find("input").get('value')
@gary-liguoliang
gary-liguoliang / setup-local-Jekyll-environment-in-10-minutes-using-Vagrant-VirtualBox.md
Last active March 26, 2017 09:36
Setup local Jekyll environment in 10 minutes using Vagrant + VirtualBox
  1. install VirtualBox v5.1.0
  2. install Vagrant v1.9.2
  3. open command line: cd c:/tmp
  4. git clone [email protected]:guoliang-dev/jekyll-vagrant.git
  5. cd jekyll-vagrant
  6. vagrant up, it may take few minutes to start the VM. it'll download a Ubuntu 14 to your PC during first time run.
  7. ssh vagrant@localhost -p 2222 with vagrant/vagrant and execute:
  cd /vagrant  # /vagrant is the share folder pointing to folder jekyll-vagrant in the host. 
jekyll new my-awesome-site
def further_process(file_name):
print 'processing :%s' % file_name
print 'processing: file: %s' % file_name
def split_to_files(s, split_start_with, split_end_with, func):
cursor = 0
while cursor >= 0:
try:
cursor = s.index(split_start_with, cursor + 1)
@gary-liguoliang
gary-liguoliang / Disable_Caps_Lock.reg
Created September 22, 2016 02:07
Disable_Caps_Lock.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@gary-liguoliang
gary-liguoliang / cout-java-import-classes.py
Created September 20, 2016 14:46
count Java import classes
"""
Copyright 2015 Guoliang Li
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
@gary-liguoliang
gary-liguoliang / convert-java-system-out-to-slf4j.py
Last active November 3, 2018 10:32
Convert all java system.out.print to SLF4J
"""
Copyright 2015 Guoliang Li
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
map z createActiveTabbedHint
map u openLinkSearchBar
let qmark a = ["http://google.com", "http://reddit.com"]
@gary-liguoliang
gary-liguoliang / designer.html
Last active August 29, 2015 14:22
designer
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
package com.liguoliang.lang.collection;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GList <T> implements Iterable<T>{
private List<T> _items = new ArrayList<T>();