markdown 突出显示ListView中的项目。

突出显示ListView中的项目。

listViewHighlight.md
*Source:* [StackOverflow](https://stackoverflow.com/a/23248559), [StackOverflow](https://stackoverflow.com/a/15917947)

**Question:** How to highlight `ListView` item by touch and by code?

**Answer:** 

```java
ListView mListView;
private ArrayList<String> mList = new ArrayList<>();
private ArrayAdapter mAdapter;

...

mAdapter = new ArrayAdapter(act, R.layout.list_item, mList);
mListView.setAdapter(mAdapter);

//register item click listener
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            //do something
        }
    });

//now just add some random String to mList and
mAdapter.notifyDataSetChanged();

//to manually select an item
mListView.setItemChecked(mHistoryList.size() - 1, true);

//to find out which item is currently checked
mListView.getCheckedItemPosition();
```

```xml
<!--Listview xml-->
<ListView
        android:id="@+id/history_view_listView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintTop_toBottomOf="parent"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:choiceMode="singleChoice"/>

```

```xml
<!--list_item xml-->
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:padding="16dp"
          android:textColor="@color/white_tint_1"
          android:textSize="16sp"
          android:background="@drawable/list_item_selector">
</TextView>

```

```xml
<!--list_item_selector xml in drawable folder-->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_activated="true"
          android:drawable="@color/activity_edit_color_widget_active_30"/>

    <item android:drawable="@color/transparent" />
</selector>

```

markdown Homebrew Cheatsheet

Homebrew-cheatsheet.md
# The Basics
```
brew install *
brew list
```

markdown 来自Hurricane Harvey的豁免县的HH QRP机构名单

来自Hurricane Harvey的豁免县的HH QRP机构名单

readme.md
### Hurricane Harvey QRS Exemptions

The list below (in three different formats) are for Home Health Agencies whose ZIP code intersects with one of the exempted counties or parishes in Texas and Louisians, as determined by CMS.

Full information about the exemption is here: [https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Hospice-Quality-Reporting/Downloads/2017-121-IP-Quality-Program-Exemptions-for-FEMA-Texas-Louisiana-Provider.pdf](https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Hospice-Quality-Reporting/Downloads/2017-121-IP-Quality-Program-Exemptions-for-FEMA-Texas-Louisiana-Provider.pdf)

Additional updates on Hurricane-related exemptions is being posted by CMS here: https://www.cms.gov/About-CMS/Agency-Information/Emergency/Hurricanes.html

The agency data was pulled on September 6th, 2017 from the CMS website here: https://data.medicare.gov/Home-Health-Compare/Home-Health-Care-Agencies/6jpm-sxkc

### Download data

* CSV: https://gist.github.com/jakebathman/be19c255b5b42ad2bab8c92d7523e49e
* JSON: https://gist.github.com/jakebathman/58bc3692d1abf22df064429d4884eafb
* XML: https://gist.github.com/jakebathman/75124c1a8c26b6fd3b2e1596d930d9a3

markdown FONTPLUS DAYセミナーVol.10 [秋の书体デザイナー祭]

report_fontplusday_10.md
# FONTPLUS DAYセミナー Vol.10 [秋の書体デザイナー祭]

## 砧書体制作所とフォントと

- 砧書体制作所 木龍 歩美さん
- 丸明朝体、いろはゴシック、丸丸ゴシックなど
- 書体につけるコピーも上手(丸丸ゴシックの「きちんとつつむ」「やさしくつつむ」)
- 昔の活字の資料を参考にしたりする
- 文字をスキャンして文字コード順に並べる作業
- 大漢字典をスキャンしたデータといろはゴシックを重ねて間をとって骨格を取り出したフォントが「芯」
  - 利用例:星野リゾート 界 ブランドサイト、猫の文学館
- 見本帳でみせ方を遊ぶと書体の特徴がみえてくる
- きりこフォントは文字と図形のあいだ
- 砧明朝体、今秋発表!

## パルラムネ

- フォントワークス株式会社 越智亜紀子さん
- パルは越智さんのブランド(筑紫的な)
- 藤田さんによると書体にも流行がある
- キャッチ系書体の今の流行りは「脱力系・可愛い(e.g. はるひ学園)」なのか?という第一発見
- 手書き書体も今の流行りなのか?という第二発見
- 外回りの営業にお願いして作った試作書体のランキングをとったら、まさかの手書き「少女文字」が一位になった
  - 手書き文字のニーズを再確認
- フォントを作るならフォントの雰囲気にあったテキストに沿って作っていくとよい
  - 越智さんのロリポップ(パルラムネの初期)場合は「花さかじいさん」「さるかに合戦」
  - 200文字ちょっと作ってあとの7000文字弱を外注に投げた
- パルラムネの利用例:子や孫にしばられない生き方、異世界銭湯
- パルレトロンをリリース予定!

## 株式会社イワタ

- 株式会社イワタ 本多育実さん
- イワタにはデザイナー(フォントの基本字を作る)、オペレーター(基本字をもとに他の字を展開する)、エンジニア(フォントをWebで使えるデータにする)でフォントを作る
- 橋本和夫氏が上司
- イワタUDフォントはUD書体のさきがけ
- イワタ明朝体オールドの利用例:コンビニ人間本文
- 弘道軒清朝体は本多さんがプッシュしてる渋い書体
- ミンゴかなはUD明朝かなBをベースに作られている
  - 明朝でもなくゴシックでもない、本文にも使える書体
- 丸ゴシック体に乞うご期待!

## パネルディスカッション

- タイプデザイナーになろうと思ったきっかけ
  - 木龍さん:日芸の広告デザインコースから入ってタイポグラフィの授業がきっかけで「文字」にハマる
  - 越智さん:木龍さんの後輩、タイポグラフィの成績がよく興味がわいた。フォントワークスに入ったのは勢いでコネを作れたから
  - 本多さん:書道から文字に興味をもって美大に入り、タイポグラフィが好きになる
  - タイプデザイナーは間口少ないのでなるのが大変

markdown 使用域访问portainer(在我们的例子中是portainer.test.dev)

使用域访问portainer(在我们的例子中是portainer.test.dev)

readme.md
```
reverseProxyPortainer
├── portainer
│   └── docker-compose.yml
└── reverseProxy
    ├── docker-compose.yml
    └── vhost.d
        └── portainer.test.dev
```    
        
1.  docker network create --driver=bridge reverseproxy_default
2.  cd reverseProxyPortainer/reverseProxy
3.  docker-compose up
4.  cd ../portainer
5.  docker-compose up
6. open /etc/hosts and add 
    127.0.0.1 portainer.test.dev
7. open your browser and go to http://portainer.test.dev and portainer UI will show




**reverseProxyPortainer/reverseProxy/docker-compose.yml**
```
version: "2"
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: reverseproxy
    restart: always
    ports:
      - "80:80"
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "./vhost.d:/etc/nginx/vhost.d:ro"
networks:
  default:
    external:
      name: reverseproxy_default
``` 




**reverseProxyPortainer/reverseProxy/vhost.d/portainer.test.dev**
```
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
```




**reverseProxyPortainer/portainer/docker-compose.yml**
```
version: '2'
services:
  portainer:
    image: portainer/portainer
    container_name: Portainer
    restart: always
    expose:
      - 9000
    ports:
      - 9000:9000
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - VIRTUAL_HOST=portainer.test.dev
      - VIRTUAL_NETWORK=reverseproxy_default

networks:
  default:
    external:
      name: reverseproxy_default
```

markdown 设置GitHub为Travis部署密钥

设置GitHub为Travis部署密钥

README.md
# Setup Travis Deploy
`gem install travis`

`ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''`

`cat github_deploy_key.pub | pbcopy`

set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys

`rm 'github_deploy_key.pub'`

`travis login --org --auto`

`travis encrypt-file 'github_deploy_key'`

`rm 'github_deploy_key'`

`git add 'github_deploy_key.enc'`

add openssl line to before_install stage in your .travis.yml e.g. 
```
before_install:
  - >-
    openssl aes-256-cbc 
    -K $encrypted_xxxxxxxxxxxx_key 
    -iv $encrypted_xxxxxxxxxxxx_iv 
    -in github_deploy_key.enc 
    -out github_deploy_key 
    -d
  - chmod 600 github_deploy_key
  - eval $(ssh-agent -s)
  - ssh-add github_deploy_key
```

`git add '.travis.yml'`

`git commit -m 'chore: add github deploy key'`

`git push`

markdown 欢迎来到Cacher

以下是一些可帮助您开始构建代码段库的提示。

cacher_intro.md
# Getting Started with Cacher

<p align="center">
<img src="http://www.cacher.io/assets/intro-snippet-splash-a90755aca4db13aac1e5140e8d7c2a7c01d9b69a640e51b55093421dff432039.png" width="480" />
</p>


## Use snippets to quickly recall commands

Snippets are the most useful when you want to re-use a shell command or a specific code pattern. Here are a few we have in our library:
- "How to delete a git tag"
- "Nginx configuration for staging server"
- "Crash handler AWS Lambda function"

## Use snippets for customer service

Engineers are often second-line customer agents. Use Cacher to store snippets for performing common support tasks.

## Labels are your friend

Labels are a great way to organize your snippets. A good practice is to have one for every major product feature. We've created the first label for you - **Documentation**.

## Create or join a team to share knowledge

Teams allow you and your colleagues to build a shared knowledge base. Use [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) to write beautifully formatted documentation. (This snippet itself is a Markdown file.)

## Use snippets for onboarding new team members

Let's face it. Having the new engineer decipher a 500 thousand-line codebase might not be an efficient use of her time. Use snippets as examples to help new members get up to speed fast.


markdown Abrir隧道pelo browsersync

Abrir隧道pelo browsersync

browser-sync_tunnel.md
## Install
```
npm install browser-sync -g
```

## Run
```
browser-sync start -p http://localhost:42555  --tunnel --xip
```

markdown Memberikan nilai默认pada列hasil迁移$ table-> timestamp()di Laravel

Memberikan nilai默认pada列hasil迁移$ table-> timestamp()di Laravel

default-current-timestamp-laravel-migrations.md
Untuk memberikan nilai default yaitu CURRENT_TIMESTAMP di column created_at dan set current timestamp on update pada column updated_at lakukan modifikasi di file migrations table `users` di dalam direktori `./database/migrations`

```php
<?php
  // hapus baris berikut
  $table->timestamp();
  // diganti menjadi seperti di bawah
  $table->timestamp('created_at')->default(\DB::raw('CURRENT_TIMESTAMP'));
  $table->timestamp('updated_at')->default(\DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));

?>

```

markdown 根据序列步骤更改窗口小部件可见性

根据序列步骤更改窗口小部件可见性

Change Visibility with Step.md.js
$scope.showImages = function() {
  //calls StepImages function every 250ms
  interval = setInterval($scope.stepImages, 250);
}

$scope.stepImages = function() {
  console.log("Current Step: "+ $scope.app.view['Home'].wdg[__nameOfWidget__]['currentStep']);
  //replace __nameOfWidget__ with name of widget which contains sequence
  if ($scope.app.view['Home'].wdg[__nameOf3DWidget__]['currentStep']==1) {
      //shows first image and hides last image (for case that last image still up from previous play)
      $scope.view.wdg[__nameOfWidget1__]['visible']=true;
      $scope.view.wdg[__nameOfWidget4__['visible']=false;
    }
    else if ($scope.app.view['Home'].wdg[__nameOf3DWidget__]['currentStep']==2) {
    //hides image from first step and shows image in second step
      $scope.view.wdg[__nameOfWidget1__]['visible']=false;
      $scope.view.wdg[__nameOfWidget2__]['visible']=true;
    }
    else if ($scope.app.view['Home'].wdg[__nameOf3DWidget__]['currentStep']==3) {
    //hides image from second step and shows image in third step
      $scope.view.wdg[__nameOfWidget2__]['visible']=false;
      $scope.view.wdg[__nameOfWidget3__]['visible']=true;
    }
    else if ($scope.app.view['Home'].wdg[__nameOf3DWidget__]['currentStep']==4) {
    //hides image from third step and shows image in fourth step then stop stepImages() from being called every 250ms
      $scope.view.wdg[__nameOfWidget3__]['visible']=false;
      $scope.view.wdg[__nameOfWidget4__]['visible']=true;
      clearInterval(interval);
    }
    $scope.$applyAsync();
}
Change Visibility with Step.md
![](https://i.imgur.com/yRZB8sj.png)