Skip to content

Instantly share code, notes, and snippets.

View davegallant's full-sized avatar
🐧
coding

Dave Gallant davegallant

🐧
coding
View GitHub Profile
@chris95x8
chris95x8 / build.gradle
Created October 28, 2014 14:00
Extended toolbar with two floating-label edit texts. The layout was made according to this image from the Material Design guidelines: http://i.imgur.com/x8QsuxU.png The layout below looks like this: http://i.imgur.com/8sOTv7h.png
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.wrapp.floatlabelededittext:library:0.0.5'
}
@brettcannon
brettcannon / steps.yml
Created January 24, 2020 22:56
GitHub Actions steps to cache VS Code stable when running extension tests
- name: Get VS Code versions
run: curl --output vscode-stable-versions.json https://update.code.visualstudio.com/api/releases/stable
- uses: actions/cache@v1
with:
path: .vscode-test/
key: ${{ runner.os }}-vscode-test-${{ hashFiles('vscode-stable-versions.json') }}
restore-keys: |
${{ runner.os }}-vscode-test-
@wridgers
wridgers / muttrc
Created May 16, 2011 18:32
mutt rc dotconfig, colours and transparent background!
---------------------------------------------------------------
~/.mutt/muttrc
---------------------------------------------------------------
color hdrdefault cyan default
color attachment yellow default
color header brightyellow default "From: "
color header brightyellow default "Subject: "
color header brightyellow default "Date: "
@squioc
squioc / gist:3078803
Created July 9, 2012 20:49
conversion between iso8601 date format and unix epoch datetime
from datetime import datetime
import calendar
def epoch_to_iso8601(timestamp):
"""
epoch_to_iso8601 - convert the unix epoch time into a iso8601 formatted date
>>> epoch_to_iso8601(1341866722)
'2012-07-09T22:45:22'
"""
@kergoth
kergoth / colorlog.py
Last active April 7, 2021 13:45
Colorizing log handler
# Courtesy http://plumberjack.blogspot.com/2010/12/colorizing-logging-output-in-terminals.html
# Tweaked to use colorama for the coloring
import colorama
import logging
import re
import sys
def remove_ansi(s):
@ivanleoncz
ivanleoncz / flask_app_logging.py
Last active May 23, 2021 07:25
Demonstration of logging feature for a Flask App.
#/usr/bin/python3
""" Demonstration of logging feature for a Flask App. """
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime
__author__ = "@ivanleoncz"
import logging
@wlonkly
wlonkly / debugging.md
Last active July 8, 2021 15:13
Steps I took to troubleshoot a full disk

I wrote this down after I responded to a page today (a holiday) because it would've been a decent pairing opportunity for a couple of new people on my team. Second best is that people can read what I did afterwards and ask me any questions. And then I realized that there's nothing PagerDuty-specific or confidential in here, so I may as well share it wider. It's hardly an epic incident, but it's a good example of "doing the work", I think. I borrowed the "write down what you learned" approach from Julia "b0rk" Evans. It's a fantastic practice.

The PagerDuty incident: "Disk will be full in 12 hours. device:/dev/nvme0n1p1, host:stg-nomadusw2-client-..."

(Note for non-PD readers: We run Nomad where others might run Kubernetes.)

Here's the process I went through.

  • Noticed that the usual docker system prune -a -f didn't resolve it
  • Tried docker system prune -a -f and it cleared up 0B
@RobertoPrevato
RobertoPrevato / aioshot.py
Last active March 11, 2022 15:19
Useful scripts
"""
aiohttp shooting
"""
import os
import asyncio
import aiohttp
import time
url = "https://example/isalive"
@jayarampradhan
jayarampradhan / Dockerfile
Last active February 23, 2023 04:27
MongoDB Docker Container (Centos 7, Mongo DB 3.x)
# Dockerizing MongoDB: 3.1 Dockerfile for building MongoDB 3.1 images
# Based on centos:centos7, installs MongoDB
FROM centos:centos7
MAINTAINER Jayaram Pradhan <jayaram.pradhan@uimirror.com>
# Set up mongodb yum repo entry
# https://www.liquidweb.com/kb/how-to-install-mongodb-on-centos-6/
RUN echo -e "\
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key