Skip to content

Instantly share code, notes, and snippets.

@michaellihs
michaellihs / tmux-cheat-sheet.md
Last active May 3, 2025 07:26
tmux Cheat Sheet
@ipbastola
ipbastola / jq to filter by value.md
Last active April 16, 2025 08:11
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@salishdev
salishdev / load-resource.scala
Created January 29, 2017 00:18
scala: load files from resources directory
def loadResource(filename: String) = {
val source = scala.io.Source.fromURL(getClass.getResource(filename))
try source.mkString finally source.close()
}
@azami
azami / sample.py
Last active October 11, 2020 12:18
SQLAlchemy Core Sample with relationship and polymorphic
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine, func
from sqlalchemy import Table, Column, Integer, String, DateTime, MetaData, ForeignKey
from sqlalchemy.pool import NullPool
from sqlalchemy.orm import mapper, sessionmaker, relationship
params = {'user': 'admin',
'password': 'password',
'host': 'localhost',
#!/usr/bin/env python3
from argparse import ArgumentParser
from urllib.parse import urlparse
from scrapy.crawler import CrawlerProcess
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
parser = ArgumentParser()
parser.add_argument('-d', '--domain')
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active July 15, 2024 05:12
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active May 1, 2025 14:42
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@sjparkinson
sjparkinson / config.yml
Last active August 18, 2022 08:27
Deploy a Fastly service using Terraform and CircleCI 2.0.
version: 2
jobs:
validate_terraform:
docker:
- image: hashicorp/terraform
steps:
- checkout
- run:
name: Validate Terraform Formatting

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@baileyparker
baileyparker / LICENSE.md
Last active July 24, 2020 09:32
Calculator parser implemented in Python

MIT License

Copyright (c) 2018 Bailey Parker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: