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
| In [1]: import reverse_geocoder as rg | |
| In [2]: coordinates = (39.99, 116.48), | |
| In [3]: results = rg.search(coordinates) | |
| Loading formatted geocoded file... | |
| In [4]: print results | |
| [{'name': 'Wangjing', 'cc': 'CN', 'lon': '116.47284', 'admin1': 'Beijing', 'admin2': '', 'lat': '39.9933'}] |
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
| # Install pip in for an virtualenv, from digital ocean documents | |
| curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python2.7 - | |
| pip install virtualenv | |
| virtualenv venv |
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
| sudo apt-get update | |
| sudo apt-get install -y git-core curl zlib1g-dev build-essential \ | |
| libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 \ | |
| libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common nodejs | |
| # Install rbenv | |
| cd | |
| git clone git://github.com/sstephenson/rbenv.git .rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
| echo 'eval "$(rbenv init -)"' >> ~/.bash_profile |
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
| setw -g mode-keys vi | |
| # Switch panels | |
| bind k selectp -U # switch to panel Up | |
| bind j selectp -D # switch to panel Down | |
| bind h selectp -L # switch to panel Left | |
| bind l selectp -R # switch to panel Right | |
| # History limit | |
| set-option -g history-limit 10000 | |
| # Display 256color for Vim | |
| set -g default-terminal "screen-256color" |
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
| # Install xcode command line tools | |
| xcode-select --install | |
| # Install home brew | |
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # Install git | |
| brew install git | |
| # Install python |
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
| --!connect jdbc:hive2://hadoop015.dx.momo.com:10000 ${hivevar:user} ${hivevar:passwd} | |
| !connect jdbc:hive2://hadoop015.dx.momo.com:10000 dm dm | |
| --beeline hive -f filename --hivevar dbname=online --hivevar partition_date=**** | |
| USE ${hivevar:dbname}; | |
| --use offline | |
| SET mapreduce.job.queuename=data; | |
| SET mapreduce.job.name="group_reocommend_evaluation_${hivevar:partition_date}"; |
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
| # template for "Guess the number" mini-project | |
| # input will come from buttons and an input field | |
| # all output for the game will be printed in the console | |
| # Mini Project 2 for An Introduction to Interactive Programming in Python | |
| # URL http://www.codeskulptor.org/#user39_L4LKshd1tOatpPt_2.py | |
| import random | |
| import simplegui |
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
| CREATE TABLE IF NOT EXISTS group_hot_coeff_20141217 | |
| ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' as | |
| SELECT | |
| group_active_member_num.group_id | |
| ,group_active_member_num.active_member_num / (group_member_num.member_num + 10) | |
| FROM | |
| ( | |
| SELECT | |
| group_id AS group_id | |
| ,COUNT(*) AS active_member_num |
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
| # For Linux Bash | |
| # Source global definitions | |
| if [ -f /etc/bashrc ]; then | |
| . /etc/bashrc | |
| fi | |
| # Color Scheme | |
| export CLICOLOR=1 | |
| export LSCOLORS=GxFxCxDxBxegedabagaced |
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
| export PATH="/usr/local/bin:$PATH" | |
| alias ll='ls -l' | |
| alias grep='grep --color=auto' | |
| export CLICOLOR=1 | |
| export LSCOLORS=GxFxCxDxBxegedabagaced | |
| # From: Candy Colored Terminal | |
| # URL http://stevelosh.com/blog/2009/03/candy-colored-terminal/ |