Skip to content

Instantly share code, notes, and snippets.

View yuripiratello's full-sized avatar

Yuri Zanola Piratello yuripiratello

View GitHub Profile
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@cauethenorio
cauethenorio / angular-request-fake-latency.js
Last active August 29, 2015 14:11
Angular app configuration to add 1s fake latency to xhr json requests
app.config(function ($httpProvider) {
$httpProvider.interceptors.push(
function ($q, $timeout) {
return {
'response': function (response) {
var deferred = $q.defer();
if (response.headers('content-type') == 'application/json')
$timeout(function() {deferred.resolve(response);}, 1000);
else
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active February 27, 2024 10:15
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
# coding: utf8
import bdb
import sys
# borrowed from: https://gist.github.com/rctay/3169104
def info(type, value, tb):
if (hasattr(sys, 'ps1')
or not sys.stdin.isatty()