This file contains hidden or 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
| var svg = d3.select("d3_chart"); | |
| var data = [4, 8, 15, 16, 23, 42]; | |
| var width = 420, barHeight = 20; | |
| var svg = d3.select("d3_chart").append("svg:svg") | |
| .attr("width", width) | |
| .attr("height", barHeight); |
This file contains hidden or 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
| var w = 400, | |
| h = 400, | |
| r = 180, | |
| inner = 70, | |
| color = d3.scale.category20c(); | |
| data = [{"label":"ONE", "value":194}, | |
| {"label":"TWO", "value":567}, | |
| {"label":"THREE", "value":1314}, | |
| {"label":"FOUR", "value":793}, |
This file contains hidden or 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
| git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset' --abbrev-commit --date=relative |
This file contains hidden or 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
| cd ~ | |
| git clone [email protected]:fangzhzh/.vim.git | |
| ln -s ~/.vim/.vimrc ~/.vimrc | |
| git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
| vim +PluginInstall +qall | |
| d ~/.vim/bundle/YouCompleteMe && ./install.py --clang-completer |
This file contains hidden or 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
| 0 1 * * * curl https://gist.githubusercontent.com/fangzhzh/7f9ed840948e81b7fc76/raw/30f2bf8dc7606ed6d8746ec8db745fb57f42c7c5/journal_with_remind.py | python | |
| 0 1 * * 1 curl https://gist.githubusercontent.com/fangzhzh/7f9ed840948e81b7fc76/raw/30f2bf8dc7606ed6d8746ec8db745fb57f42c7c5/journal_with_remind.py | python /dev/stdin week | |
| 0 1 1 * * curl https://gist.githubusercontent.com/fangzhzh/7f9ed840948e81b7fc76/raw/30f2bf8dc7606ed6d8746ec8db745fb57f42c7c5/journal_with_remind.py | python /dev/stdin month |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # a simple way to parse shell script arguments | |
| # | |
| # please edit and use to your hearts content | |
| # | |
| ENVIRONMENT="dev" |
This file contains hidden or 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
| Picasso.with(getContext()) | |
| .load(CONST.IMAGE_SERVER + cover.image_url) | |
| .into(new Target() { | |
| @Override | |
| public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) { | |
| Bitmap bmOverlay = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig()); | |
| Bitmap play= BBAppResource.bitmap(R.drawable.btn_me_account); | |
| Canvas canvas = new Canvas(bmOverlay); | |
| canvas.drawBitmap(bitmap, new Matrix(), null); | |
| float left = (float)((bitmap.getWidth()-play.getWidth())/2.0); |
This file contains hidden or 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
| android.applicationVariants.all { variant -> | |
| def applicationId = variant.applicationId | |
| def adb = androidadbExe. as String | |
| def variantName = variant.name.capitalize() | |
| def grantPermissionTask = task.create("create${variantName}Permissions") << { | |
| "${adb} devices".execute().text.eachLine { | |
| if(it.endsWith("device")){ | |
| def device = it.split()[0] | |
| println "Granting permissions on devices ${device}" | |
| "${adb} -s ${devices} shell pm grant ${applicationId} android.permission.ACCESS_FINE_LOCATION".execute() |
This file contains hidden or 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
| BufferedReader br = null; | |
| try { | |
| br = new BufferedReader( | |
| new FileReader(output.getAbsolutePath() + ".log")); | |
| String line; | |
| double totalSecs = 0; | |
| double totalFps = 0; | |
| while (keepReading) { | |
| line = br.readLine(); | |
| if (line == null) { |
This file contains hidden or 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
| ffmpeg started on 2016-07-20 at 23:25:03 | |
| Report written to "/storage/emulated/0/Android/data/com.garena.videodemo/cache/comp_VID_20160703_172409.mp4.log" | |
| Command line: | |
| ffmpeg -y -i /storage/emulated/0/Download/VID_20160703_172409.mp4 -crf 33 -preset ultrafast -loglevel trace /storage/emulated/0/Android/data/com.garena.videodemo/cache/comp_VID_20160703_172409.mp4 | |
| ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers | |
| built with gcc 4.9 (GCC) 20140827 (prerelease) | |
| configuration: --target-os=linux --arch=x86 --cpu=i686 --enable-yasm --enable-cross-compile --cross-prefix=i686-linux-android- --prefix=/Users/zhangzf/android/libs/gcodec/external/build/x86 --sysroot=/Users/zhangzf/android/libs/gcodec/external/build/x86/toolchain/sysroot --enable-small --enable-static --disable-shared --enable-pic --enable-asm --enable-inline-asm --enable-gpl --enable-libx264 --disable-doc --disable-symver --disable-gray --disable-swscale-alpha --disable-hwaccels --disable-iconv --disable-programs --disable-ffmpeg --d |
OlderNewer