Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mkoby on github.
  • I am mkoby (https://keybase.io/mkoby) on keybase.
  • I have a public key ASCuYID2JnSDplUfONleZN2KiMrgq8RXLtUxvgUv-o1rQgo

To claim this, I am signing this object:

@mkoby
mkoby / encode_videos.sh
Last active January 4, 2016 10:59
Bash script to encode videos for CodeCasts.tv. Uses ffmpeg to encode to Theory (Ogg), WebM (vp8), and h.264 (x264). This version of the script doesn't require ffmpeg2theora or HandbrakeCLI, so less requirements all around. Need to get the WebM to create a smaller file.
#!/bin/bash
# This shell script will process & encode a single video file, and output 3
# seperate files in the following formats: WebM, Ogg Theora, & h.264 for
# streaming via an HTML5 player.
#
# You'll need ffmpeg, libvorbis, libvpx, & x264 installed to run this
# script. ffmpeg can be installed via Homebrew on a Mac.
# Modifications made for resolution and quality where needed.
$('#add_webpage, #add_bag, #add_bag_to_webpages, #add_divider, #add_blurb').on('hidden', function() {
return $.clearInput();
});
%ul.nav.nav-tabs
%li{ :class => "#{ "active" if @BasAllActive }" }
= link_to "all", bags_url(:id => h(@user.username))
%small (#{@user.bags.count})
#all_tag_and_query
- if @BasAllTips && !@tag.blank?
= render :partial => '/share/arr_and_tag', :locals => { :bags_count => @bags.total_entries, :tag => @tag }
%li{ :class => "#{ "active" if @DraftActive }" }
= link_to "draft", bags_by_scope_url(:id => h(@user.username), :extra_params => "draft")
%small (#{@user.bags.unpublish.count})
@mkoby
mkoby / git_merge_conflicts.sh
Created March 6, 2013 17:09
Version Control with Git - 08 - Merge Conflicts
#Set the mergetool
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd 'diffmerge --merge --result="$MERGED" "$LOCAL" "$(if test -f "$BASE"; then echo "$BASE"; else echo "$LOCAL"; fi)" "$REMOTE"'
#Tell git to trust the mergetool's exit code, this way git doesn't always ask if the merge was successful
git config --global mergetool.diffmerge.trustExitCode true
#When a merge conflict happens, you can load the mergetool with
git mergetool
@mkoby
mkoby / git_branching.sh
Created March 6, 2013 16:57
Version Control with Git - 05 - Branching
#Create a new 'dev' branch in Git
git branch dev
#See a list of branches
git branch
#You can switch to the branch using 'checkout'
git checkout dev
#If you want to checkout and create a new branch in a single command run
@mkoby
mkoby / git_remotes.sh
Created March 5, 2013 17:12
Version Control with Git - 04 - Remotes
# To set up a local remote of our current repository, we need to do a few things
# Here I assume the directory to the repository is ~/codecasts.tv/cctv_git (where we'll be doing the work)
cd ~/codecasts.tv
git clone --bare ~/codecasts.tv/cctv_git #This creates a new directory, ~/codecasts.tv/cctv_git.git, that acts like a remote
# Now we will clone the remote to our 'local' box as Harry (developer #1)
mkdir harry
cd harry
git clone ~/codecasts.tv/cctv_git.git
@mkoby
mkoby / Keymap.xml
Last active June 9, 2019 13:40
XBMC Keymap File for Logitech Harmony Remote
<!-- PLACE IN .xbmc/userdata/keymaps/Keymap.xml -->
<!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not -->
<!-- used in the current window's section. Note that there is only handling -->
<!-- for a single action per button at this stage. -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox -->
<!-- gamepads. -->
<!-- The format is: -->
<!-- <device> -->
@mkoby
mkoby / gist:3061287
Created July 6, 2012 16:49
Git Basics
mkdir cctv_git #Make directory
cd cctv_git #change to newly crated directory
git init #Create git repository in directory
#Configure Git
git config --global user.name “CodeCasts.tv”
git config --global user.email contact@codecasts.tv
git config --list #just to confirm that our settings were applied
#Create A README file with some contents
@mkoby
mkoby / using_gems.rb
Created June 19, 2012 19:00
Intro to Ruby - 16 - Gems
# First you need to install the gem
# gem install chronic
# You should see it say "1 gem installed" when it's done
#
# Then open IRB
require 'chronic'
Chronic.parse(‘tomorrow’) # => tomorrow's date
Chronic.parse(‘2 weeks from next monday’) # => date that's 2 weeks from the next monday