This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| local RemoveComments = function() | |
| local ts = vim.treesitter | |
| local bufnr = vim.api.nvim_get_current_buf() | |
| local ft = vim.bo[bufnr].filetype | |
| local lang = ts.language.get_lang(ft) or ft | |
| local ok, parser = pcall(ts.get_parser, bufnr, lang) | |
| if not ok then return vim.notify("No parser for " .. ft, vim.log.levels.WARN) end | |
| local tree = parser:parse()[1] |
| local RemoveComments = function() | |
| local ts = vim.treesitter | |
| local bufnr = vim.api.nvim_get_current_buf() | |
| local ft = vim.bo[bufnr].filetype | |
| local lang = ts.language.get_lang(ft) or ft | |
| local ok, parser = pcall(ts.get_parser, bufnr, lang) | |
| if not ok then return vim.notify("No parser for " .. ft, vim.log.levels.WARN) end | |
| local tree = parser:parse()[1] |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
So you think you wanna be a web developer... Fork this, update your copy with answers. They don't need to be precise - pseudo-code is fine in most cases. Some questions don't have correct answers.
| module TaxCodeStrategies | |
| class UnitedStates | |
| def call(id) | |
| "US-#{id}" | |
| end | |
| end | |
| class Brazil | |
| def call(id) | |
| "#{id}-BR" |
| # Convert any YouTube video into an audio file you can listen to on the go, using: | |
| # http://rg3.github.com/youtube-dl/ | |
| { ~ } > brew install ffmpeg | |
| { ~ } > brew install ffprobe | |
| { ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
| { ~ } > chmod u+x youtube-dl | |
| # Pick which video format you want to download.. (use any YT video link) |
| class ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
| end | |
| end | |
| ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
| #! /usr/bin/env ruby | |
| # usage: | |
| # $ das_download.rb email password [download_directory] | |
| require 'mechanize' | |
| # gem 'mechanize-progressbar' | |
| email = ARGV[0] or raise('Please provide the email address for your account') | |
| password = ARGV[1] or raise('Please provide the password for your account') | |
| path = ARGV[2] || './' |