Skip to content

Instantly share code, notes, and snippets.

View jollychang's full-sized avatar
🎼
Focusing

William Zhang jollychang

🎼
Focusing
View GitHub Profile
for i in $(printf '%03d\n' {500..1000})
do
url="http://qaci.intra.douban.com/job/peteris-opening-pull-request-scanner/5$i/consoleText"
if curl -s $url| grep -q "FAILURE"; then
echo $url
curl -s $url | grep "for PR"
fi
done
@jollychang
jollychang / appium_highlife.py
Created September 4, 2014 06:51
appium for highlife android script
#!/usr/bin/env python
# coding: utf-8
import os
from time import sleep
from selenium import webdriver
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(os.path.join(os.path.dirname(__file__), p))
#!/usr/bin/env bash
#
# Copyright (c) 2013 Jonathan Penn (http://cocoamanifest.net)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@jollychang
jollychang / echo_robot_testcase_name.py
Created August 22, 2014 06:15
echo robotframework testcase name
from robot.parsing import TestCaseFile
def print_tag_is_core():
suite = TestCaseFile(source='./test_base.txt').populate()
for test in suite.testcase_table:
if 'core' in test.tags.value:
print test.name
@jollychang
jollychang / install.sh
Created August 22, 2014 06:14
install and launch apk by adb
mvn clean package
adb uninstall com.douban.shuo
adb install app/target/*mvn.apk
adb shell am start -n com.douban.shuo/.app.WelcomeActivity
nbproject
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
# encoding: UTF-8
namespace :simulator do
desc "Call 'Reset Content and Settings' in iOS Simulator menu"
task :reset do
%x{
osascript <<-END
tell application "iPhone Simulator" to activate
tell application "System Events"
tell process "iPhone Simulator"
@jollychang
jollychang / lme_mo.py
Created August 6, 2014 08:31
check MOLYBDENUM price
import requests
url = 'http://www.quandl.com/api/v1/datasets/OFDP/MOLYBDENUM_56'
r = requests.get(url)
data = r.json().get('data')
print data
if data[0][-1] > data[1][-1]:
print 'price is rise'

Git basic

Commit

Pricinple

  • One commit one small feature or bug fix
  • Include unit test in one commit
  • Exclude non-associated files
  • Don't commit un-finished or wrong code