Skip to content

Instantly share code, notes, and snippets.

@christo16
christo16 / gist:8320177
Created January 8, 2014 17:00
ffmpeg log
[ac3 @ 0xb842fe0] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[ac3 @ 0xb842fe0] exponent out-of-range
[ac3 @ 0xb842fe0] error decoding the audio block
[ac3 @ 0xb842fe0] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
[ac3 @ 0xb842fe0] exponent out-of-range
[ac3 @ 0xb842fe0] error decoding the audio block
[ac3 @ 0xb842fe0] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
@christo16
christo16 / osx_homebrew_rvm_rails_unixodbc_sqlserver.md
Created May 2, 2011 20:15 — forked from sixfeetover/osx_homebrew_rvm_rails_unixodbc_sqlserver.md
Setup OS X 10.6.4 w/ homebrew, rvm, rails, unixodbc, freetds and SQL Server

Setup new mac from scratch

These commands are good as of 2010-11-18.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Install xcode (download, or on the OS X install DVD)

http://developer.apple.com/technology/xcode.html
@christo16
christo16 / monkey_patches.rb
Created February 10, 2011 11:19
Pretty Rails logs-> config/initializers/monkey_patches.rb
#
# ActiveSupport patches
#
module ActiveSupport
# Format the buffered logger with timestamp/severity info.
class BufferedLogger
NUMBER_TO_NAME_MAP = {0=>'DEBUG', 1=>'INFO', 2=>'WARN', 3=>'ERROR', 4=>'FATAL', 5=>'UNKNOWN'}
NUMBER_TO_COLOR_MAP = {0=>'0;37', 1=>'32', 2=>'33', 3=>'31', 4=>'31', 5=>'37'}
@christo16
christo16 / Parse error :(
Created January 28, 2011 15:41
AppController.j
/*
* AppController.j
* streams
*
* Created by You on January 28, 2011.
* Copyright 2011, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@christo16
christo16 / Mac- Open ports
Created January 28, 2011 10:33
Ports in use
sudo lsof -i -P | grep -i "listen"
@christo16
christo16 / Ruby Date Strings
Created December 27, 2010 16:55
Ruby Date Strings
Format meaning:
%a - The abbreviated weekday name (``Sun'')
%A - The full weekday name (``Sunday'')
%b - The abbreviated month name (``Jan'')
%B - The full month name (``January'')
%c - The preferred local date and time representation
%d - Day of the month (01..31)
%H - Hour of the day, 24-hour clock (00..23)
%I - Hour of the day, 12-hour clock (01..12)
@christo16
christo16 / mysqldump script
Created December 20, 2010 11:34
mysqldump script
#mysql info
HOST=127.0.0.1
USER=root
PASS=1234
DB=database
#gzip which
GZIP="$(which gzip)"
# Get data in dd-mm-yyyy format
NOW="$(date +"%d-%m-%Y")"
@christo16
christo16 / setup db on production server
Created December 15, 2010 16:22
rake db:migrate RAILS_ENV=production
rake db:migrate RAILS_ENV=production
@christo16
christo16 / OS X Create Saved SSH Keys
Created December 13, 2010 15:15
OS X Create Saved SSH Keys
# local machine
$ cd ~/.ssh
$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/Users/user/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/user/.ssh/id_dsa.
Your public key has been saved in /Users/user/.ssh/id_dsa.pub
@christo16
christo16 / Rails State Select
Created December 3, 2010 00:08
Create a select list for US states in Rails
<%= select(:address, :state, [
['Select a State', 'None'],
['Alabama', 'AL'],
['Alaska', 'AK'],
['Arizona', 'AZ'],
['Arkansas', 'AR'],
['California', 'CA'],
['Colorado', 'CO'],
['Connecticut', 'CT'],
['Delaware', 'DE'],