Skip to content

Instantly share code, notes, and snippets.

@efinal
efinal / gist:cf6187b38b8519e77aad528a479d7af8
Created March 23, 2018 14:50
griffon application can't show message.properties with utf8 encoding correctly by default
check the source code as described here: https://stackoverflow.com/a/4660195/828181, it's because the PropertiesReader use the default 'ISO-8859-1' encoding.
the solution is binding your own PropertiesReader and read the stream as utf-8:
public class PropertiesReader extends griffon.util.PropertiesReader {
@Nonnull
public Properties load(@Nonnull InputStream stream) throws IOException {
Properties p = new Properties();
p.load(new InputStreamReader(stream, "UTF-8"));
return this.processProperties(p);
}
@efinal
efinal / gist:96a561d24fa9254711c9d66bbd0fa52d
Last active December 2, 2016 13:49
index page of your browser has been changed to hao.169x.cn 浏览器被劫持
浏览器被劫持到http://hao.169x.cn/?v=108
index page of your browser has been changed to hao.169x.cn
here is the solution:
1, delete scheduled tasks related to your OEM Hacker. like KMS10 AND KMSSERVER. delete them. (just in the root folder of scheduled tasks)
将任务计划程序中的和激活程序相关的删除。可能在根目录下面,也可能在OEM目录或者其他目录下面。比如KMS10以及KMSSERVER
2,download WMI tools (seems microsoft doesn't provider it any more, you can google it or download here)
下载wmi tools。微软的官方网站好像不再提供下载了。你可以goolge自行搜索,也可以在这里下载
@efinal
efinal / gist:66800214112f9e035538
Last active August 29, 2015 14:03
How to remote debug phpunit tests with phpstorm 8 EAP
I'm developing php laravel application with an ubuntu vm hosted on a windows system. codes are shared through share folder between vm and host. the mounting place is /mnt/hgfs/server_php.
here are the steps I figured out which can enable you debug phpunit tests remotely with remote php interpreter inside phpstorm 8 EAP
first, please ensure you are installing phpunit in server through composer:
add "phpunit/phpunit": "4.0.0", in your composer.json and run composer update
1) download phpstorm 8 EAP: http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program
2) configure deployment option:
@efinal
efinal / gist:9093723
Created February 19, 2014 14:57
Deploy gitlab with apache2 and unicorn in another port
#1, reference
https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/web-server/apache/gitlab-apache2.4.conf
http://serverfault.com/questions/512527/gitlab-with-apache-proxy
i created the following vhost configuration
#2, modify /home/git/gitlab/config/unicorn.rb:
comment the line like which listen through the socket and make sure it's listening through tcp port
# listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
listen "localhost:20000", :tcp_nopush => true"
@efinal
efinal / gist:6458934
Created September 6, 2013 02:48
Generate Random KP statistics
var kp = ['时间的估测','时间的测量','长度的估测','长度的测量','刻度尺的使用','机械运动','参照物及其选择','运动和静止的相对性','速度与物体运动','速度公式及其应用','速度的计算','运动快慢的比较','匀速直线运动','声音的产生','声音的传播条件','声速','声音在不同介质中的传播速度','声速的大小跟介质温度的关系','人耳的构成','人耳感知声音的过程及听到声音的条件','骨传声及骨传导的原理','双耳效应','音调','频率及音调的关系','超声波与次声波','响度','响度与振幅的关系','音色','音调、响度与音色的区分','回声','回声测距离的应用','声与信息','声与能量','声音的综合利用','声音的等级和噪声的危害','防治噪声的途径','温度','摄氏温度及其计算','液体温度计的构造与工作原理','温度计的使用及其读数','温度计与体温计的异同','体温计的使用及其读数','熔化与熔化吸热特点','凝固与凝固放热特点','汽化及汽化吸热的特点','沸腾及沸腾条件','沸点及沸点与气压的关系','蒸发及其现象','影响蒸发快慢的因素','液化及液化现象','液化方法及其应用','探究水的沸腾实验','升华和凝华的定义和特点','生活中的升华现象','生活中的凝华现象','水的三态变化','光源','光在均匀介质中直线传播','光直线传播的应用','光的传播速度与光年','光的反射','光的反射定律','作光的反射光路图','镜面反射','漫反射','镜面反射和漫反射的异同点','平面镜对光的作用','平面镜成像的特点、原理、现象及其实验方案','平面镜成虚像的原因','实像与虚像的区别','平面镜成像的相关作图','平面镜的应用','凸面镜和凹面镜','光的折射规律','光折射的可逆性','光的折射现象及其应用','作光的折射光路图','光的色散','色光的三原色和颜料的三原色','物体的颜色','透镜及其分类','辨别凸透镜和凹透镜的方法','主光轴、光心、焦点和焦距','凸透镜的会聚作用','凹透镜的发散作用','透镜的光路图','生活中的透镜','凸透镜成像规律及其探究实验','凸透镜成像的应用','眼睛及其视物原理','近视眼的成因与矫正办法','远视眼的成因与矫正办法','显微镜','望远镜','质量及其特性','质量的估测','质量的
@efinal
efinal / README.md
Last active December 22, 2015 10:28 — forked from mbostock/.block
KP Analysis

知识点分析