Skip to content

Instantly share code, notes, and snippets.

🤓
Hacking my way through this world..

T.V.VIGNESH tvvignesh

🤓
Hacking my way through this world..
Block or report user

Report or block tvvignesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fvigotti
fvigotti / purge_prom_pushgateway.sh
Created Oct 1, 2018
this is a sample script that clean old metrics from pushgateway, not very clean but working anyway, used as sample in a issue
View purge_prom_pushgateway.sh
trap 'echo "got sigterm" ; exit 0' SIGTERM
EXPIRATION_SECONDS=${EXPIRATION_SECONDS:-900}
PGW_URL=${PGW_URL:-http://pushgateway}
function convert_to_standardnotation(){
# convert number from scientific notation to standar d( ie '1.5383780136826127e+09' )
printf '%.0f' $1
}
@GitRay
GitRay / serialize.py
Last active May 24, 2019 — forked from mrocklin/serialize.py
Serialization benchmark
View serialize.py
# This has been edited to work with python3. Some of the tested combinations will not work in python2.
import pandas as pd
df = pd.DataFrame({'text': [str(i % 1000) for i in range(1000000)],
'numbers': range(1000000)})
import pickle
# Python 3 has no cPickle
#import cPickle
import json
from functools import partial
@Rich-Harris
Rich-Harris / service-workers.md
Last active Jun 16, 2019
Stuff I wish I'd known sooner about service workers
View service-workers.md

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active Jun 18, 2019
Event-stream based GraphQL subscriptions for real-time updates
View Event-stream based GraphQL subscriptions.md

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.

Conceptual Model

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.

@craigbeck
craigbeck / introspection-query.graphql
Created Apr 6, 2016
Introspection query for GraphQL
View introspection-query.graphql
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
You can’t perform that action at this time.