Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
String.prototype.render = function(obj) { | |
return this.replace(/\$\{(\w+|\w+\.\w+)\}/g, match => { | |
var keys = match.replace('${', '').replace('}', '').split('.') | |
return keys.reduce((acc, cv) => acc[cv], obj) | |
}) | |
} | |
String.prototype.render = function (obj) { | |
with(obj) { | |
return eval('`' + this + '`') |
const DateType = new GraphQLScalarType({ | |
name: 'DateType', | |
description: '自定义时间类型', | |
parseValue: String, | |
serialize(value) { | |
return value.toString(); | |
}, | |
parseLiteral(ast) { | |
if (!moment(ast.value).isValid()) { | |
throw new GcBaseError('非法时间'); |
var http = require('http'); | |
var net = require('net'); | |
var url = require('url'); | |
function request(cReq, cRes) { | |
var u = url.parse(cReq.url); | |
var options = { | |
hostname : u.hostname, | |
port : u.port || 80, |
var http = require('http'); | |
var net = require('net'); | |
var url = require('url'); | |
function request(cReq, cRes) { | |
var u = url.parse(cReq.url); | |
var options = { | |
hostname : u.hostname, | |
port : u.port || 80, |
#!/bin/bash | |
# | |
# chkconfig: 2345 77 22 | |
# description: Test Service | |
# | |
LOCKFILE=/var/lock/subsys/myservice | |
status() { | |
if [ -e $LOCKFILE ]; then | |
echo "Running..." |
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
digraph architecture { | |
rankdir=LR; | |
// Storage - #303F9F (dark blue) | |
node[fillcolor="#303F9F" style="filled" fontcolor="white"]; | |
database[label="DB"]; cache[label="Redis"]; | |
// Client-side Apps - #FFEB3B (yellow) | |
node[fillcolor="#FFEB3B" style="filled" fontcolor="black"]; | |
front_end[label="Front-end App"]; extension[label="Browser Extension"]; |
@Configuration | |
public class PrometheusAutoConfigure { | |
@Bean | |
SpringBootMetricsCollector springBootMetricsCollector(Collection<PublicMetrics> publicMetrics) { | |
SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector(publicMetrics); | |
springBootMetricsCollector.register(); | |
return springBootMetricsCollector; |
func main() { | |
c, err := clientv3.New(clientv3.Config{ | |
Endpoints: []string{"ip:port"}, | |
DialTimeout: 5 * time.Second, | |
}) | |
if err != nil { | |
panic(err) | |
} | |
lockKey := "/lock" |