Convert video from MP4 format to FLV format
$brew install ffmpeg
$ffmpeg -i input_file.mp4 -f flv output.flv
- ffmpeg - runs the program
- -i input_file.mp4 - input file
- -f flv - force format followed by format
- output.flv - output file
Convert video from MP4 format to FLV format
$brew install ffmpeg
$ffmpeg -i input_file.mp4 -f flv output.flv
Creating a patch
git format-patch -1 commit-sha
Applying a patch
git apply PATCH_FILENAME
set nocompatible " choose no compatibility with legacy vi | |
syntax enable | |
set encoding=utf-8 | |
set showcmd " display incomplete commands | |
"" Whitespace | |
set nowrap " don't wrap lines | |
set softtabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4) | |
set expandtab " use spaces, not tabs (optional) | |
set backspace=indent,eol,start " backspace through everything in insert mode |
Using ack, xargs and sed in shell -
ack -l old_str | xargs sed -i -e "s/old_str/new_str/g"
Example ack -l excerpt | xargs sed -i -e "s/excerpt/description/g"
Using VIM -
Doing this will be quite complicated in vim as explained by Drew Neil in vimcasts.org
Create an object ex: obj = String.new
obj.methods
- List all methodsobj.methods.sort
- List all methods in sorted orderobj.methods.grep(REGEX)
- List all methods matching a regular expressionobj.methods - Object.methods
- List all methods not present in parent object Objectobj.respond_to :method_name
- Check if object responds to a method##Hacker Notes ?
Allow new developers to catch up right things from the start by collaborating on Hacker Notes. Improve Hacker Notes pages by voting on resources or adding new resources. Find, share and learn interesting stuff.
If you own a Github Repository - Add resources to your repository page. Share it with developers, link it to your project README or WIKI.
If you like a HackerNotes page best way to share it is link it to corresponding project WIKI or README.
Eg. https://github.com/etsy/statsd/wiki#blog-posts-and-links
Restore postgres database from sql file -
psql <databasename> -U <username> < ~/Downloads/<filename>.sql
Find and replace a word in a directory -
find path-to-directory -type f -not -path "./directory/*" -exec sed -i '' 's/old-word/new-word/g' {} \;
To compress directory with Tar -
var offset = 4; | |
$(window).scroll(function() { | |
if($(window).scrollTop() + $(window).height() > ($(document).height() - 150)) { | |
loadMore(offset); | |
offset = offset + 4; | |
} | |
}); | |
function loadMore(offset) { |