This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# call markdown to convert markdown -> html in memory | |
def mkd2html(inFilename): | |
# | |
# and there are different ways to handle windows and unix | |
# also subprocess.check_output exist in python27 only. | |
# | |
cmd = [] | |
# mostly msysgit is used, cygwin, it is win32 platform | |
if sys.platform == "win32": | |
# i may need to check cygwin as well |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<!-- file is based on jenkin's solution https://github.com/jenkinsci/jenkins/commit/f0fa10bd63487e8754c678f2984e5bd655a51aa6 | |
& latest pom.xml | |
https://github.com/jenkinsci/jenkins/blob/master/war/pom.xml | |
--> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example.demo</groupId> | |
<artifactId>helloworld2-war</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will run as root the first time the virtual machine boots | |
# | |
# set proxy if needed | |
sudo echo "http_proxy=http://proxy.server/" >> /etc/environment | |
export http_proxy=http://proxy.server:8080/ | |
## #Expire the user account | |
apt-get update | |
apt-get upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://projecteuler.net/problem=1 | |
total = 0; | |
for i in range(1,1000): | |
if (i % 3 == 0) or (i % 5 ==0): | |
# print i; | |
total += i; | |
print "the sum of all the multiples of 3 or 5 below 1000: " , total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://projecteuler.net/problem=2 | |
total = 0; | |
a,b = 0,1 | |
while a<4000000: | |
a,b = b,a+b | |
if a %2 == 0: | |
print a; | |
total += a; | |
print total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# solution from http://weibo.com/1937408130 | |
total = sum([x for x in range(1,1000) if x % 3 == 0 or x % 5 == 0]) | |
print total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{enumerate}\setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt} | |
\item | |
item1 | |
\item | |
item2 | |
\end{enumerate} | |
\begin{enumerate}\setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt} | |
\item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aruba/cucumber' | |
module ArubaOverrides | |
def detect_ruby(cmd) | |
processor, platform, *rest = RUBY_PLATFORM.split("-") | |
#puts platform | |
if platform =~ /w32$/ && cmd =~ /^mkbok / #mkbok is the real command in features | |
"ruby -I../../lib -S ../../bin/#{cmd}" | |
else | |
"#{cmd}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import csv | |
import sys | |
# read sample tuleap csv header to avoid some field changes | |
tuleapcsvfile = open('tuleap.csv', 'rb') | |
reader = csv.DictReader(tuleapcsvfile) | |
# open stdout for output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
hello2.py hello world sample | |
Usage: hello2.py [options] | |
Options: | |
-m messages message list, separare by ',' | |
-h this help | |
Mail bug reports and suggestion to : Larry Cai <larry.caiyu AT gmail.com> |
OlderNewer