Skip to content

Instantly share code, notes, and snippets.

View dylanninin's full-sized avatar
🏠
Working from home

dylanninin dylanninin

🏠
Working from home
View GitHub Profile
@dylanninin
dylanninin / build.xml
Last active December 28, 2015 02:09
Ant build.xml for Java Web Application. Be free to use it as a template and modify at will. Reference http://ant.apache.org/
<?xml version="1.0" encoding="utf-8"?>
<!-- build.xml -->
<!-- 2013-11-12 dylanninin@gmail.com init -->
<project name="SSH" default="dist.deploy" basedir=".">
<!-- properties for packages and source -->
<property name="package.top" value="com/egolife/ssh" description="SSH项目顶层包结构" />
<property name="src.dir" value="src" description="src文件夹" />
<!-- properties for resource-->
@dylanninin
dylanninin / build-flex.xml
Created November 12, 2013 05:30
Flex with Ant Task build-flex.xml for Java Web Application using Adobe Flex as frontend. Be free to use it as a template and modify at will. Reference http://ant.apache.org/, http://flex.apache.org/
<?xml version="1.0" encoding="utf-8"?>
<!-- build-flex.xml -->
<!-- 2013-11-12 dylanninin@gmail.com init -->
<project name="FLEX" default="test" basedir=".">
<!--Flex properties and targets-->
<!--Flex SDK-->
<property name="FLEX_HOME" value="D:/Flex/sdks/3.2.0" />
<property name="MXMLC.JAR" value="${FLEX_HOME}/lib/mxmlc.jar" />
@dylanninin
dylanninin / testcase.tpl
Created November 12, 2013 05:39
A Jinja2 template for rendering source code of jUnit testcase in Java web applications, especially for interfaces. It just shows the basic design, you can impletement it better with Python or Java, either is good.
package {{tc.toPackage}};
{% for import in tc.imports %}
import {{import}};{% endfor %}
/**
* {{tc.testCase}}.java
* {{tc.comment.abstract}}:
* TestCase (JUnit) for {{tc.service}}
* {{tc.comment.history}}
* {{tc.comment.date}} {{tc.comment.author}} {{tc.comment.content}}
@dylanninin
dylanninin / log4j.properties
Created November 12, 2013 05:48
A configuration for log4j properties. Be free to use it as a template and modify at will. Reference http://logging.apache.org/
#Log4J配置
#定义日志输出级别和输出流重定向
#修订历史:
# 2013-11-12 dylanninin@gmail.com init
log4j.rootLogger=CONSOLE,ROLLING_FILE,MAIL
log4j.addivity.org.apache=true
#####################################################################
#输出日志信息到控制台 级别INFO
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
@dylanninin
dylanninin / rake.log
Created November 12, 2013 13:52
A Rake -T output sample.
$ rake -T
rake about # List versions of all Rails frameworks and the environment
rake assets:clean # Remove old compiled assets
rake assets:clobber # Remove compiled assets
rake assets:environment # Load asset compile environment
rake assets:precompile # Compile all the assets named in config.assets.precompile
rake db:create # Create the database from DATABASE_URL or config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)
rake db:drop # Drops the database using DATABASE_URL or the current Rails.env (use db:drop:all to drop all databases)
rake db:fixtures:load # Load fixtures into the current environment's database
@dylanninin
dylanninin / ping.py
Created November 29, 2013 08:52 — forked from pklaus/ping.py
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
@dylanninin
dylanninin / excel_test.py
Created January 16, 2014 01:02
使用xlrd,xlwt,进行读写Excel文件,测试中文是否乱。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Excel读写测试
#使用xlrd,xlwt,进行读写Excel文件,测试中文是否乱码
#修订历史:
# 2014-1-15 dylanninin@gmail.com init
def read_excel(excel):
"""Read data from excel, which is supposed to be an excel."""
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #