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
ticker := time.NewTicker(frequency) | |
defer ticker.Stop() | |
for range ticker.C { | |
// do your stuff | |
} |
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(){ | |
var d=document, | |
z=d.createElement('scr'+'ipt'), | |
b=d.body, | |
l=d.location; | |
try{ | |
if(!b)throw(0); | |
z.innerHTML = "location.href = km_path + '/users/login?ref_url=' + encodeURI(location.href);"; | |
b.appendChild(z); | |
}catch(e){ |
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
DROP TABLE IF EXISTS tmp_dels; | |
CREATE TABLE tmp_dels AS SELECT subscribe_tags.id FROM subscribe_tags, ( SELECT max(id) AS id, nick, tag_id FROM subscribe_tags GROUP BY nick, tag_id HAVING count(1) > 1 ) t WHERE subscribe_tags.nick = t.nick AND subscribe_tags.tag_id = t.tag_id AND subscribe_tags.id < t.id; | |
DELETE FROM subscribe_tags WHERE id IN (SELECT id FROM tmp_dels); | |
DROP TABLE IF EXISTS tmp_dels; |
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
<?php | |
$order = array("\r\n", "\n", "\r"); | |
$replace = ''; | |
$str=str_replace($order, $replace, $str); | |
?> |
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
查看列:desc 表名; | |
修改表名:alter table t_book rename to bbb; | |
添加列:alter table 表名 add column 列名 varchar(30); | |
删除列:alter table 表名 drop column 列名; | |
修改列名MySQL: alter table bbb change nnnnn hh int; | |
修改列名SQLServer:exec sp_rename't_student.name','nn','column'; | |
修改列名Oracle:lter table bbb rename column nnnnn to hh int; | |
修改列属性:alter table t_book modify name varchar(22); |
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
SELECT * FROM your_table ORDER BY RAND() |
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
date --date='1 years ago' +%Y |
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
[Names] | |
count=1 | |
name0=Solarized Dark | |
[Solarized Dark] | |
text(bold)=839496 | |
magenta(bold)=dd3682 | |
text=839496 | |
white(bold)=fdf6e3 | |
green=859900 | |
red(bold)=cb4b16 |
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
netstat -abno |
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
CREATE TABLE `search_info_new` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键,自增', | |
`query` varchar(256) CHARACTER SET utf8 DEFAULT NULL COMMENT '备注', | |
`created_by` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建此记录的人', | |
`created` datetime DEFAULT NULL COMMENT '创建此记录的时间', | |
PRIMARY KEY (`id`), | |
KEY `idx_query` (`query`(255)) USING BTREE | |
) ENGINE=InnoDB AUTO_INCREMENT=3407821 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
NewerOlder