Skip to content

Instantly share code, notes, and snippets.

View christos's full-sized avatar

Christos Zisopoulos christos

View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@softprops
softprops / ecs-exec.sh
Last active November 25, 2022 02:30
when you want `docker exec` but your containers live on ecs container instances. assumes an vpn bastion host
#!/usr/bin/env bash
# runs an arbitrary command on a remote ecs target
#
# usage: `ecs-exec bash`
#
# ssh credentials
#
# Add the following to your ~/.ssh/config file
#
# Assumes ec2 bastion key for authenicating
@hopsoft
hopsoft / prefetch.js
Last active December 27, 2023 02:45
Turbolinks Prefetching
const hoverTime = 400
const fetchers = {}
const doc = document.implementation.createHTMLDocument('prefetch')
function fetchPage (url, success) {
const xhr = new XMLHttpRequest()
xhr.open('GET', url)
xhr.setRequestHeader('VND.PREFETCH', 'true')
xhr.setRequestHeader('Accept', 'text/html')
xhr.onreadystatechange = () => {
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 26, 2024 04:52
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@ferblape
ferblape / geolocation.js
Created June 17, 2017 09:35
JQuery free IP geolocation
$(document).ready(function(){
$.getJSON("http://jsonip.com/?callback=?", function (ipData) {
$.getJSON("https://freegeoip.net/json/" + ipData.ip, function (geoData) {
console.log(geoData.city);
});
});
});
@ldez
ldez / gmail-github-filters.md
Last active April 3, 2024 11:53
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@fertapric
fertapric / ecs-run
Last active December 10, 2018 05:00
Script to run a Docker container with the same configuration as the ECS service: environment variables and Docker image. It uses ecs-env: https://gist.github.com/fertapric/4ae3a1209e7118c275821ce35512daec
$ ecs-run
Run a Docker container with the same configuration as an ECS service.
It uses the same image and environment variables of the ECS task definition.
Supported AWS CLI environment variables:
- AWS_ACCESS_KEY_ID: AWS access key.
- AWS_SECRET_ACCESS_KEY: AWS secret key.
- AWS_SESSION_TOKEN: session token.
- AWS_DEFAULT_REGION: AWS region.
@fertapric
fertapric / ecs-env.sh
Last active January 2, 2021 21:20
Script to extract environment variables from a ECS service
#!/bin/sh
print_help() {
echo "Extract environment variables from an ECS service."
echo
echo "Usage: $0 [OPTIONS] SERVICE"
echo
echo "Options:"
echo " -h, --help Print usage"
}
@SamSaffron
SamSaffron / gist:2a1c96e37e022153d86d06f9d0a7bf26
Last active December 31, 2016 16:32
How to run Discourse tests really fast

Tips for optimizing performance of the Discourse gigantic test suite

Change memory allocator

default:            9:37
tcmalloc:           8:32
lockless:           8:19
jemalloc 3.6.0: 7:45