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:
## Hack to connect multiple Parrot AR Drones. | |
############################################# | |
## Instructions: | |
## 1. Connect to your AR Drone wifi network. | |
## 2. Open your terminal and do 'telnet 192.168.1.1' | |
## 3. Copy the script and replace DRONE_ID with the desired ID number (between 3-255). | |
## 4. Paste and run the script for every drone on the swarm. | |
DRONE_ID=200 | |
sed -i "s/PROBE=1/PROBE=${DRONE_ID}/" /bin/wifi_setup.sh |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
source "https://rubygems.org" | |
gem "octokit" | |
gem "nokogiri" | |
gem "json" |
#!/bin/sh | |
sudo apt-get update \ | |
&& sudo apt-get install -qy docker.io | |
sudo apt-get update \ | |
&& sudo apt-get install -y apt-transport-https \ | |
&& curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
# config/initializers/activestorage.rb | |
Rails.application.config.to_prepare do | |
# Provides the class-level DSL for declaring that an Active Record model has attached blobs. | |
ActiveStorage::Attached::Macros.module_eval do | |
def has_one_attached(name, dependent: :purge_later, acl: :private) | |
class_eval <<-CODE, __FILE__, __LINE__ + 1 | |
def #{name} | |
@active_storage_attached_#{name} ||= ActiveStorage::Attached::One.new("#{name}", self, dependent: #{dependent == :purge_later ? ":purge_later" : "false"}, acl: "#{acl}") | |
end |