This file contains 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
(function() { | |
'use strict'; | |
function removeAds () { | |
document.getElementById('ad') && document.getElementById('ad').remove(); | |
document.getElementById('advertisement') && document.getElementById('advertisement').remove(); | |
} | |
removeAds(); | |
This file contains 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
# shortform git commands | |
alias g='git' | |
# get list of followers from github username | |
curl -s https://api.github.com/users/username/followers | grep '\"login\"' | sed -e's/[,|"|:]//g' | awk '{print $(NF)}' | sort | |
# git commit random alias | |
git config --global alias.commit-random '!git commit -m "$(curl -s http://whatthecommit.com/index.txt)"' | |
usage: git commit-random |
This file contains 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
1.修改vagrant配置文件 | |
Vagrant.configure(2) do |config| | |
... | |
config.vm.network "forwarded_port", guest: 3306, host: 3306 | |
... | |
end | |
2.修改vagrant box中mysql配置文件 | |
sudo sed -i 's/bind-address.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf sudo service mysql restart |
This file contains 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
ALTER TABLE ADM_TYPE_TARGET MODIFY TARGET_NAME VARCHAR(20) CHARACTER SET utf8; |
This file contains 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
server { | |
server_name domainname.com www.domainname.com; | |
root /var/www/; | |
listen 80; | |
index index.html index.htm index.php; | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
} |
This file contains 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
Open a command prompt as administrator and paste the following to install chocolatey: | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
Install vcredist2010 using the following command (again, as administrator): | |
choco install -y vcredist2010 |
This file contains 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
//copy公钥到指定主机,以使得可以通过ssh命令登录该主机 | |
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server | |
//ssh登录某主机 | |
ssh root@server |
This file contains 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
//block声明 | |
返回值类型 block名称 参数1及类型 参数2及类型 | |
void (^blockName)(type argument1, type argument2) | |
//block定义 | |
void ^(type argument1, type argument2){ | |
//do something | |
} | |
//注意block中的循环引用,在block中如果出现对block持有者的强引用,会导致内存泄露。此时应使用__weak修饰变量。 |
This file contains 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
Expression Utility Objects | |
Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions. | |
#dates: utility methods for java.util.Date objects: formatting, component extraction, etc. | |
#calendars: analogous to #dates, but for java.util.Calendar objects. | |
#numbers: utility methods for formatting numeric objects. | |
#strings: utility methods for String objects: contains, startsWith, prepending/appending, etc. | |
#objects: utility methods for objects in general. | |
#bools: utility methods for boolean evaluation. | |
#arrays: utility methods for arrays. |