Skip to content

Instantly share code, notes, and snippets.

View noamtamim's full-sized avatar

Noam Tamim noamtamim

View GitHub Profile
@noamtamim
noamtamim / ghpush.sh
Last active September 18, 2015 19:49
#!/bin/bash
# Simple GitHub push (https://developer.github.com/v3/repos/contents/#create-a-file)
# Mandatory arguments, as env vars:
# INPUT_FILE: local file to upload
# REPO_FULL_NAME: username/reponame
# REPO_PATH: full target path name (path/to/targetFile.txt)
# GH_TOKEN: an oauth2 access token (https://github.com/settings/tokens)
g1
@noamtamim
noamtamim / SelfExpiringHashMap.java
Created September 4, 2017 11:23 — forked from pcan/SelfExpiringHashMap.java
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2017 Pierantonio Cangianiello
*
* MIT License
*
* 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
@noamtamim
noamtamim / docx2md.md
Last active February 19, 2018 20:37 — forked from jesperronn/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@noamtamim
noamtamim / mp4-to-mp3.md
Created May 15, 2019 20:11
Convert mp4 files to mp3 (extract audio from mp4)

Convert mp4 files to mp3 (extract audio from mp4)

Assuming a simple mp4 with one video stream and one audio stream.

for f in *.mp4
do 
  ffmpeg -i "$f" "${f%mp4}mp3"
done
@noamtamim
noamtamim / docker-compose.yml
Created November 29, 2019 14:36
Simple Prometheus Docker Compose setup
version: '3.7'
volumes:
prometheus_data: {}
# Setup:
# The app root directory contains an "etc" subdir with the config files required by all containers.
# Docker Compose creates an internal network for all containers so they can call each other by name.
services:
Country WIFI 2G 3G 4G
AD 3500 148 2200 5300
AE 3500 95 490 690
AF 470 95 810 1400
AG 1100 148 2200 3200
AI 3500 200 2200 1400
AL 3500 132 2200 3200
AM 2000 132 970 2000
AO 1100 95 970 5300
AR 2000 115 970 2000