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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "prometheus", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
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
#/usr/bin/python | |
import sys | |
sys.path.append("/usr/local/lib/python2.7/site-packages") | |
import random | |
import grpc | |
from interface import authentication_pb2 | |
from interface import authentication_pb2_grpc | |
from interface import groups_pb2 | |
from interface import groups_pb2_grpc |
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
#!/usr/bin/env python2.7 | |
import re | |
from elasticsearch import Elasticsearch | |
from elasticsearch_dsl import Search | |
from elasticsearch_dsl.query import Q | |
class RequestList(object): | |
def __init__(self, host, method_name): | |
#self.max_distance = |
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
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
import base64 | |
import requests | |
from PIL import Image | |
import cStringIO | |
import os.path | |
import argparse | |
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
#!/usb/bin/env python | |
import psycopg2 | |
import argparse | |
def get_xaily_messages(conn, x): | |
with conn.cursor() as cur: | |
cur.execute(""" | |
SELECT COUNT(DISTINCT message_id), date_trunc('%s', date) AS quant | |
FROM history_messages |
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
protected def interleaveDevices(devices: List[Device], busId: EventBusId, msgFactory: Device ⇒ ApiWebRTCSignaling): Future[Unit] = { | |
(devices |@| devices).tupled.filter(d => d._1.deviceId != d._2.deviceId).foldLeft(FastFuture.successful[Unit](())) { | |
case (acc, (left, right)) => | |
acc *> postFromThisDevice(busId, left, msgFactory(right).toByteArray) *> postFromThisDevice(busId, right, msgFactory(left).toByteArray) | |
} | |
} |
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
object UnregisterCredentials { | |
def unapply(c: UnregisterPushCredentials.Creds): Option[PushCredentials] = c match { | |
case apple if apple.isApple => apple.apple | |
case google if google.isGoogle => google.google | |
case _ => None | |
} | |
} |
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 t (id bigint primary key, c bigint not null) | |
BEGIN; | |
UPDATE t SET c=1 WHERE id=1; | |
INSERT INTO t (id, c) SELECT 1, 1 WHERE NOT EXISTS (SELECT 1 FROM t WHERE id=1); | |
END; | |
-- pg 9.4.8 | |
-- contraint violation: duplicate key `id` |
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 cats.data.Xor | |
import io.circe.parser._ | |
import io.circe._ | |
import io.circe.generic.encoding.DerivedObjectEncoder | |
import io.circe.syntax._ | |
import io.circe.generic.semiauto._ | |
sealed trait X | |
case class A(i: Int) extends X | |
case class B(i: Int) extends X |
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
(ns myns | |
(:require-macros [cljs.core.async.macros :refer [go-loop]]) | |
(:require [ajax.core :refer [ajax-request raw-response-format]])) | |
(def html5supported? | |
(not (or (undefined? js/File) | |
(undefined? js/Blob) | |
(undefined? js/FileList) | |
(not (or js/Blob.prototype.webkitSlice js/Blob.prototype.mozSlice js/Blob.prototype.slice false))))) |
NewerOlder