Skip to content

Instantly share code, notes, and snippets.

@jychen7
jychen7 / table.md
Last active May 9, 2022 01:03
InfluxDB vs Prometheus
InfluxDB/TICK Prometheus
data collection 1.8: Push
2.0: Push & Pull
Pull
data type float, int, bool, string float
time accurancy nanoseconds milliseconds
storage InfluxDB TSDB
retention custom by database global
query language 1.8: InfluxQL (SQL) and Flux
2.0: Flux (functional)
PromQL (functional)
downsampling Yes, CQ or Kapacitor No
aggregation Yes, CQ or Kapacitor Yes, recording rules
@jychen7
jychen7 / mget_vs_pipeline.rb
Last active October 15, 2019 14:50
mget_vs_pipeline
require "benchmark"
$:.push File.join(File.dirname(__FILE__), 'lib')
require 'redis'
ITERATIONS = 10_000
BATCHES = [10, 100, 1_000, 10_000]
@r = Redis.new
@jychen7
jychen7 / list_tags.sh
Created January 13, 2019 05:00
List all tags of a image in Docker Hub
wget -q https://registry.hub.docker.com/v1/repositories/python/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@jychen7
jychen7 / google_wifi.md
Created April 5, 2018 11:04
Device Location List
  • Attic
  • Back yard
  • Basement
  • Bathroom
  • Bedroom
  • Den
  • Dining Room
  • Entryway
  • Family Room
  • Front yard
@jychen7
jychen7 / JYDropDownTableViewController.h
Created March 4, 2014 15:04
a simple Drop Down Table View
#import <UIKit/UIKit.h>
@interface JYDropDownTableViewController : UITableViewController{
BOOL textNeedCenter;
CGFloat alpha;
}
@property (strong,nonatomic) UIView* parentView;
@property (strong,nonatomic) NSObject* parentObject;
@jychen7
jychen7 / keyrepeat.shell
Created November 3, 2012 04:36 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text 2 in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@jychen7
jychen7 / exportjson.js
Created October 23, 2012 13:34 — forked from pamelafox/exportjson.js
Google Spreadsheet JSON Export
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';