Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
https://www.postgresql.org/docs/9.4/static/monitoring-stats.html | |
https://www.postgresql.org/docs/9.4/static/functions-admin.html | |
-- show blocking pids in a nice tree | |
-- query as blocked_query | |
-- 9.6++ | |
select pid, usename, | |
age(query_start, clock_timestamp()), | |
pg_blocking_pids(pid) as blocked_by, | |
query |
var facade = require('facade'), | |
handlers = require('handlers'); | |
app.use("/verification/:verificationId", funciton (req, res) { | |
facade.getUserForVerificationId(req.params.verificationId) | |
.then(handlers.successHandler, handlers.errorHandler); | |
}); |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
#!/usr/bin/env bash | |
# fresh-chrome | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
query
mutation
Reference implementation also adds the third type: subscription
. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
<?php | |
/** | |
* Post a message from a bot to a group | |
* | |
* $groupId (string) GroupId of the group to post the message | |
* $strMessage (string) Text of the message to post (limit of 1000 characters) | |
* $strBotId (string) ID of the bot which will post the message | |
* $mentionUsers (array) [optional] array of userIds to mention (uses attachment) | |
* Example array of userIds: |
/** | |
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
* templates and such with AngularJS. Use this simple directive to | |
* tame this beast once and for all. | |
* | |
* Usage: | |
* <input type="text" autofocus> | |
* | |
* License: MIT | |
*/ |
package main | |
import ( | |
"log" | |
"math" | |
) | |
func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
var round float64 | |
pow := math.Pow(10, float64(places)) |
package t | |
import ( | |
"time" | |
) | |
type NowFunc func() time.Time | |
var Now = func() time.Time { return time.Now() } | |
func NowForce(unix int) { |