Skip to content

Instantly share code, notes, and snippets.

View akarca's full-sized avatar
🏠
Working from home

Serdar Akarca akarca

🏠
Working from home
View GitHub Profile
@akarca
akarca / gist:d3a44e2a629d8581179cab086a012fbf
Created September 24, 2018 13:11
credit card formatter
var getFormattedValue = function (value, blocks, delimiter) {
var result = '',
currentDelimiter;
var blocksLength = blocks.length;
// no options, normal input
if (blocksLength === 0) {
return value;
}
@akarca
akarca / install_ffmpeg.sh
Created May 13, 2018 22:04 — forked from Piasy/install_ffmpeg.sh
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@akarca
akarca / udp_server.py
Created May 10, 2018 18:27 — forked from majek/udp_server.py
Simple python udp server
import logging
import socket
log = logging.getLogger('udp_server')
def udp_server(host='127.0.0.1', port=1234):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@akarca
akarca / gist:f0619406f9e808cdb9c1939e674f8cb1
Created March 25, 2018 00:08
getting yesterday's timestamp with date command on mac and linux
#!/bin/bash
unameOut="$(uname -s)"
case "${unameOut}" in
Darwin*) yesterday=$(date -v-1d "+%s");;
*) yesterday=$(date +%s --date="-1 days");;
esac
echo $yesterday