Skip to content

Instantly share code, notes, and snippets.

View Troland's full-sized avatar
🎯
Focusing

Tris Roland Troland

🎯
Focusing
  • China
View GitHub Profile
/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg
/[^.]\s*require\s*\(\s*[/']([^'/\s]+)[/']\s*\)/g
/\b(.)\1+\b/
// test example /\b(.)\1+\b/.test([1,1,1].join(''))
@Troland
Troland / RegexInteger.txt
Created June 28, 2018 15:20
RegexInteger include zero
/^\d+$/
"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;
/* 后端数据 */
var data = {
"10;20;30": {
price: 5,
count: 1
},
"10;20;31": {
price: 10,
count: 2
},
根据给定字符串进行按位数反转,如:字符串abcdef按2位反转得到字符串cdefab
PS:
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。
```javascript
// you code
```
2. 粘贴代码时请使用shift+tab,缩进前面的空白。
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):
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
$ 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