Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shady shady-robot

🎯
Focusing
View GitHub Profile
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@shady-robot
shady-robot / DateTime
Last active Dec 29, 2018
A reference for datetime format
View DateTime
Mostly about the java.time package, about time and date format issue.
Nothing Special, just for reference.
@shady-robot
shady-robot / SQL syntax
Created Jul 20, 2015
SQL statement for privileges management in MySQL
View SQL syntax
####This is a cheat sheet for mysql syntax, which is mostly about privilege management in mysql.
---------------------------------------------------------------------------------------------------------------------
### List all the user in mysql(with access to the mysql database)
mysql> select user, host, password from mysql.user;
### Create a user with password
mysql> create user 'shady'@'localhost' identified by 'password';
### Create a user without password
mysql> create user 'eric'@'localhost';
-----------------------------------------------------------------------------------------------------------------------
View How to install tmux on centos 7
Tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal.
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila.
Since the title was about centos 7, then do the following step to install tmux.
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default.
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ tar xzvf libevent-2.0.21-stable.tar.gz
$ cd libevent-2.0.21-stable
$ ./configure && make
View Django common settings
How to install mysql-client to connect django and MySQL:
(1). Make sure the MySQL is installed
(2). Use the following command to install the package:
Ubuntu:
$sudo apt-get install libmysqlclient-dev
CentOS:
$ sudo apt-get install mysql-devel
(3). inside the virtualenv
View temp
在发送一个REST API请求时,根据应用的场景,针对相同的资源,可能会期待不同的返回形式。
Rest API应具备完整的内容协商能力
通过在header里面设置 Accept:告诉WEB服务器自己接收的内容类型,内容类型中的先后次序表示客户端接收的先后次序。 */* 表示任何类型,type/* 表示该text/html,application/json
请求不支持的格式:415 Unsupported Media Type
--->
(1). 返回内容格式指定
http://gym.api.ruizhutech.com/activities/251/entrances/?format=json
(2). 通过在header里面指定
http://gym.api.ruizhutech.com/activities/251/entrances/
@shady-robot
shady-robot / iterm2-solarized.md
Created Dec 24, 2019 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k