Skip to content

Instantly share code, notes, and snippets.

@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active December 24, 2023 12:10 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
@pavelbinar
pavelbinar / download-mp3.sh
Last active June 7, 2016 08:02
Download MP3 from YouTube
# Source: https://askubuntu.com/questions/178481/how-to-download-an-mp3-track-from-a-youtube-video
youtube-dl --extract-audio --audio-format mp3 <video URL>
@pavelbinar
pavelbinar / docker-tricks.sh
Created March 1, 2016 14:48
Stop / remove all Docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@pavelbinar
pavelbinar / gist:8a3ad117e94de9dc8d15
Created November 30, 2015 17:03
install_for_mac_or_for_linux.sh
#!/bin/bash
# Script to launch installer jar based on linux/mac os
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
sudo java -jar "${BIN_DIR}/Installer.jar" tv $@
else
sudo java -XstartOnFirstThread -jar "${BIN_DIR}/Installer.jar" tv $@
fi
@pavelbinar
pavelbinar / index.html
Created October 13, 2015 12:04 — forked from anonymous/index.html
Two Columns With Different Items Alignment // source http://jsbin.com/vasilopeca
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Two Columns With Different Items Alignment</title>
<style id="jsbin-css">
.column {
position: absolute;
width: 200px;
height: 300px;
@pavelbinar
pavelbinar / osx-for-hackers.sh
Last active August 29, 2015 14:25 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@pavelbinar
pavelbinar / gist:01521316c4f528eac2b0
Last active August 29, 2015 14:25 — forked from tomraithel/gist:3852171
SASS: mixin for absolute center position
@mixin center($width, $height) {
position: absolute;
left: 50%;
top: 50%;
height: $height;
width: $width;
margin-left: - $width / 2;
margin-top: - $height / 2;
}
@pavelbinar
pavelbinar / README.md
Last active August 29, 2015 14:25 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@pavelbinar
pavelbinar / topkeywords.js
Last active August 29, 2015 14:25 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
# Bash Prompt
function color_my_prompt {
local __user_and_location="\n\[\e[32;1m\](\[\e[37;1m\]\u\[\e[32;1m\])-(\[\e[37;1m\]\w\[\e[32;1m\])"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt="\n(\[\[\e[37;1m\]! \!\[\e[32;1m\])-> \[\e[0m\]"
export PS1="$__user_and_location $__git_branch $__prompt "
}
color_my_prompt
alias editbash='nano ~/.bash_profile'