A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| # In Gemfile: gem 'agora_dynamic_key', '~> 0.1.0' | |
| require 'dynamic_key' | |
| class Agora | |
| EXPIRATION_TIME_IN_SECONDS = 3600*3 | |
| def generate_rtc_token channel_name = 'any_channel_name' | |
| params = { |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| # Why? | |
| # To paste text into windows that normally don't allow it or have access to the clipboard. | |
| # Examples: Virtual machines that do not yet have tools installed, websites that hijack paste | |
| # | |
| # Extended vs Simple? | |
| # * Includes an initial delay to allow you to change active windows | |
| # * Adds small delay between keypresses for slower responding windows like SSH sessions | |
| # * Better handling of numbers | |
| # * VMWare bug fix | |
| # |
| var argv = require('minimist')(process.argv.slice(2)); | |
| var fs = require('fs'); | |
| var csvParse = require('csv-parse'); | |
| var csvStringify = require('csv-stringify'); | |
| var moment = require('moment'); | |
| if (argv._.length === 0) { | |
| console.log('Usage: node tax --year 2014 Libra.csv output.csv'); | |
| process.exit(); | |
| } |
This is an easy way to integrate a basic Instagram feed into a WordPress site.
First, register with Instagram's developer program, then register a client. Set the client ID they provide you in line 4.
Second, get your Instagram user ID by running this in your terminal:
curl -X GET https://api.instagram.com/v1/users/search\?q\=USERNAME\&client_id\=CLIENT_ID
| # applescript | |
| # add login item | |
| osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}' | |
| # delete login item | |
| osascript -e 'tell application "System Events" to delete login item "itemname"' | |
| # list loginitems | |
| osascript -e 'tell application "System Events" to get the name of every login item' |
| ## | |
| # OSX defaults, based on http://mths.be/osx | |
| # | |
| # Ask for the administrator password upfront | |
| sudo -v | |
| # Set computer name (as done via System Preferences → Sharing) | |
| sudo scutil --set ComputerName "air" | |
| sudo scutil --set HostName "air" |
| <?php | |
| if (!function_exists('get_post_id_by_meta_key_and_value')) { | |
| /** | |
| * Get post id from meta key and value | |
| * @param string $key | |
| * @param mixed $value | |
| * @return int|bool | |
| * @author David Mårtensson <david.martensson@gmail.com> | |
| */ | |
| function get_post_id_by_meta_key_and_value($key, $value) { |