Skip to content

Instantly share code, notes, and snippets.

@msumit
msumit / memcache_keys.rb
Last active August 29, 2015 14:07
List local memcached keys using Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'net/telnet'
require 'dalli'
@msumit
msumit / gist:c1452034c0dd482db012
Created June 8, 2015 09:06
benchmarking system vs File
require 'rubygems'
require 'benchmark'
require 'fileutils'
iterations = 1000
Benchmark.bm do |bm|
puts "write to a file using backticks"
bm.report do
iterations.times do
@msumit
msumit / s3_sensor.py
Last active June 20, 2024 07:42
Airflow file sensor example
from airflow import DAG
from airflow.operators.sensors import S3KeySensor
from airflow.operators import BashOperator
from datetime import datetime, timedelta
yday = datetime.combine(datetime.today() - timedelta(1),
datetime.min.time())
default_args = {
'owner': 'msumit',
@msumit
msumit / redis_xcom.py
Created December 4, 2020 08:35
Apache Airflow CustomXCom Backend for Redis
# This is an example to show how easy to extend the custom XCom backends in Apache Airflow.
# File: airflow/providers/redis/xcom/redis_xcom.py
# Author: Sumit Maheshwari
import json
import logging
from typing import Any
import uuid
from airflow.configuration import conf