Skip to content

Instantly share code, notes, and snippets.

@fitzyyf
fitzyyf / gist:4064801
Created November 13, 2012 09:17
Maven Flexmojos compile locales
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<directory>target</directory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.0-RC2</version>
<extensions>true</extensions>
<executions>
@fitzyyf
fitzyyf / Sublime text 2
Created December 3, 2012 01:42
My Sublime text 2 Settings
{
// 代码提示的控制范围
"auto_complete_selector": "source",
// 主题设置
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
// 代码地图的可视区域部分加上边框
"draw_minimap_border": true,
// 字体设置
"font_face": "PT Mono",
// 字体大小
# 同时创建src/main/java和src/main/resources 以及 src/test/java 和 src/test/resouces 四个maven标准的目录
mkdir -p src/{main,test}/{java,resources}
@fitzyyf
fitzyyf / gradle idea web facet
Created January 5, 2013 04:48
Gradle create Idea Engineering Web facet
// Helper methods to get the directory in which to deploy webapps (add-ons).
File getDeployLoc() {
file("$buildDir/"+war.baseName.toLowerCase())
}
idea {
project {
//if you want to set specific jdk and language level
@fitzyyf
fitzyyf / my zsh theme
Created January 6, 2013 00:35
I zsh theme from the the blinks theme modified from.
# https://github.com/blinks zsh theme
CURRENT_BG='NONE'
SEGMENT_SEPARATOR='⮀'
function _prompt_char() {
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
echo "%{%F{blue}%}⚙%{%f%k%b%}"
else
echo '%{%F{cyan}%}λ'
fi
@fitzyyf
fitzyyf / gist:4640358
Created January 26, 2013 05:22
Guava BloomFilter Base Sample
/*
* Copyright (c) 2012-2013 www.iflytek.com. All Rights Reserved.
* This software for customer relationship management system, developed by Ifly@ZY team.
* Software code and design for the team, copy rights reserved.
*/
package com.ifkytek.irime;
import java.util.Set;
@fitzyyf
fitzyyf / gist:4640364
Last active December 11, 2015 18:19
Google Guava BloomFilter
/*
* Copyright (c) 2012-2013 www.iflytek.com. All Rights Reserved.
* This software for customer relationship management system, developed by Ifly@ZY team.
* Software code and design for the team, copy rights reserved.
*/
package com.ifkytek.irime;
import java.util.Set;
@fitzyyf
fitzyyf / shard-start.sh
Created March 5, 2013 12:08
mongo-shard
#!/bin/sh
# 创建数据和配置文件
mkdir -p ~/dbs/config
mkdir -p ~/dbs/shard1
mkdir -p ~/dbs/shard2
# 启动服务器
@fitzyyf
fitzyyf / gist:5260276
Created March 28, 2013 03:16
Google Guava Stream to String
// FSDataInputStream,支持随机访问
final FSDataInputStream in = fs.open(new Path(hdfs_file_uri));
try {
// 设置从第八行开始读取
InputSupplier<? extends InputStream> supplier = new InputSupplier<InputStream>() {
@Override
public InputStream getInput() throws IOException {
return in;
}
@fitzyyf
fitzyyf / gist:5276821
Last active November 30, 2017 13:33
Python 通过SSH执行远程命令
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# See http://www.cnblogs.com/ma6174/archive/2012/05/25/2508378.html
import pexpect
import paramiko
import threading
import yaml