Base dev libs
sudo yum groupinstall "Development Tools" -yInstall EPEL
| # Launch pry based interactive Rails console | |
| $> pry -r ./config/environment.rb | |
| # redirect Mongoid logging to console | |
| pry(main)> Mongoid.logger = Logger.new($stdout) | |
| # run a query | |
| pry(main)> User.where(:username => "greg").first() | |
| # Mongoid spits out the query, but, I actually want to see the raw Mongo query |
| // how to programatically create NSLayoutConstraints inside a playground | |
| import UIKit | |
| let viewFrame = CGRect(x: 0, y: 0, width: 640, height: 750) | |
| let view = UIView(frame: viewFrame) | |
| view.backgroundColor = UIColor.greenColor() | |
| // initially the subView will obscure the entire view | |
| let subView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.Dark)) |
Rotate all videos in current directory 90 degrees and remove rotate metadata that's used by iOS & Quicktime.
find *.mp4 | xargs -I {} ffmpeg -i "{}" -v 0 -vf "transpose=1" -qscale 0 -y -metadata:s:v:0 "rotate=0" "rotated/{}"Print the width, height and filename for every video in the current directory
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "github.com/boltdb/bolt" | |
| ) |
| package main | |
| import ( | |
| "log" | |
| "os" | |
| "github.com/boltdb/bolt" | |
| ) | |
| var path = "bolt.db" |
| package main | |
| import ( | |
| "crypto/rand" | |
| "fmt" | |
| "io" | |
| "net" | |
| "sync/atomic" | |
| "time" | |
| ) |