Skip to content

Instantly share code, notes, and snippets.

View nezed's full-sized avatar
🇺🇦

D. Naumov nezed

🇺🇦
  • 00:22 (UTC +02:00)
View GitHub Profile
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@orjan
orjan / checkout-pr.md
Last active August 7, 2020 21:40
Checkout pull request in Bitbucket server

Checking out pull requests in Bitbucket

/.git/config
[remote "origin"]
    url = ssh://git@git.dev.viaeuropa.int:7999/brikks/brikks.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = +refs/pull-requests/*/from:refs/remotes/origin/pull-requests/*
    fetch = +refs/pull-requests/*/merge:refs/remotes/origin/pull-requests-merge/*
@Integralist
Integralist / Datadog Monitoring and Metrics.md
Last active January 23, 2024 21:17
[Datadog Monitoring and Metrics] #datadog #metrics #monitoring #cost
@jackofseattle
jackofseattle / gist:e28631e321bdd607200b
Created May 28, 2015 21:51
connect to stores as a decorator for flummox
const React = require('react');
const connectToStores = require('flummox/connect');
function connect(...args) {
return function(target) {
return connectToStores(target, ...args);
}
}
@afilhodaniel
afilhodaniel / gist:09a1df8eafeabe1584c6
Last active November 12, 2020 10:20
Upload photos to Instagram via private API with Ruby
class InstagramPrivateController < ApplicationController
def initialize(username, password, photo, caption)
@username = username
@password = password
@photo = photo
@caption = caption
@cookiepath = Tempfile.new('cookies').path
@user_agent = generate_user_agent()
@denji
denji / http-benchmark.md
Last active June 20, 2024 14:22
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@agarciadom
agarciadom / find-color-pages
Last active January 21, 2024 18:56
Small Python 2.7+ script that lists the color pages in a PDF along with their CMYK ink mixes, as computed by the 'inkcov' device in Ghostcript 9.05+. "find-color-pages file.pdf" lists the color pages and their CMYK ink mixes, "find-color-pages -c file.pdf" prints the number of color pages in the PDF and "find-color-pages -C 0.39 -B 0.04 file.pdf…
#!/usr/bin/env python
# Simple script for finding and counting the color pages in a PDF
# Copyright (C) 2013-2019 Antonio Garcia-Dominguez
# Licensed under the GPLv3
#
# This script is based on the following thread (thanks for the tip!):
#
# http://tex.stackexchange.com/questions/53493
#
@NapoleonWils0n
NapoleonWils0n / curl_time_to_first_byte.sh
Created November 3, 2012 22:33
bash: curl time to first byte
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://inserturl.here