Skip to content

Instantly share code, notes, and snippets.

View ibelem's full-sized avatar
🖖

Belem Zhang ibelem

🖖
  • Intel Corporation
  • Shanghai, PRC
  • X @ibelem
View GitHub Profile
@ibelem
ibelem / adb
Last active August 29, 2015 14:03
$ python make_apk.py --package=org.china.autotest
--name=Badminton --app-root='/home/badminton' --app-local-path='index.html'
$ adb install Badminton_x86.apk
Get Activity from Crosswalk-8.36.170.0/Badminton/AndroidManifest.xml
<activity android:label="Badminton" android:name="org.china.autotest.BadmintonActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
@ibelem
ibelem / notepad.html
Last active August 29, 2015 14:10 — forked from jdkanani/notepad.html
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@ibelem
ibelem / gist:601ab278b426eef76fc0
Last active August 29, 2015 14:15
Coding Style Guides
Python
https://www.python.org/dev/peps/pep-0008/
Class Names and Exception Names
CapWords
Method Names and Instance Variables
Lowercase with words separated by underscores as necessary
Leading underscore only for non-public methods and instance variables
@ibelem
ibelem / gist:ca9a0574b3e92c75cf21
Last active August 29, 2015 14:15
Work with react and react-canvas
$ git clone github:Flipboard/react-canvas.git
$ cd react-canvas
react-canvas$ sudo npm install -g react-tools
react-canvas$ sudo npm install -g react
react-canvas$ npm install
* [optional] Update package.json dependencies "scroller" if clone failed
react-canvas$ git clone github:mjohnston/scroller
cd scroller
for export proxy
# vim /etc/zsh/zshrc
export DISPLAY=":0.0"
vim /etc/ssh/ssh_config
Host github
Hostname github.com
IdentityFile ~/.ssh/id_rsa
@ibelem
ibelem / gist:45f713c07bb38d573097
Created February 27, 2015 07:10
manifest.json
{
"name": "Deepin Test",
"manifest_version": 1,
"version": "0.0.0.1",
"description": "A sample application"
"xwalk_description": "A sample application with XWALK_"
"app": {
"launch":{
"web_url": "http://web.im.baidu.com"
}
sudo update-alternatives --config python3
conda activate base
conda deactivate
# 第一步:在你的用户文件下新建一个文件夹,这个.npm-global 名字可以用你自己喜欢的名字替换,推荐直接使用这个名字。
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
vim ~/.profile
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
@ibelem
ibelem / @ SimpleDB.md
Created December 9, 2016 08:28
Simple DB

SimpleDB - Like Indexed DB, but Simple

A simple asynchronous data store.

STATUS: This is a thought experiment, not a serious proposal. Would basic async storage like this be useful? With this plus some locking primitive, could you build Indexed DB?

Like Indexed DB:

  • rich value types - store anything you can structured clone
  • rich key types - Number, String, Date, Array (of other key types)
@ibelem
ibelem / .travis.linux.yml
Created August 7, 2018 07:08 — forked from chitoku-k/.travis.linux.yml
ChromeDriver on Travis CI
os: linux
node_js: '7'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
sources:
- google-chrome
packages: