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
/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg |
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
/[^.]\s*require\s*\(\s*[/']([^'/\s]+)[/']\s*\)/g |
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
/\b(.)\1+\b/ | |
// test example /\b(.)\1+\b/.test([1,1,1].join('')) |
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
/^\d+$/ |
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
"use strict"; | |
/** | |
* 11 12 13 14 15 | |
* 21 22 23 24 25 | |
* 31 32 33 34 56 | |
* 41 42 43 44 45 | |
* 51 52 53 54 55 | |
*/ | |
//var maps = []; | |
var log = console && console.log; |
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
/* 后端数据 */ | |
var data = { | |
"10;20;30": { | |
price: 5, | |
count: 1 | |
}, | |
"10;20;31": { | |
price: 10, | |
count: 2 | |
}, |
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
根据给定字符串进行按位数反转,如:字符串abcdef按2位反转得到字符串cdefab | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
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
import requests | |
def read_google(q): | |
return requests.get('https://www.google.com', params={'q': q}) | |
def bunch_of_requests(): | |
results = [] | |
for i in range(100): |
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
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
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
$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
$ rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt | |
$ rpm -K rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
$ rpm -i rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm | |
$ sudo yum install git-gui |