Skip to content

Instantly share code, notes, and snippets.

View DevinThompson's full-sized avatar

Devin Thompson DevinThompson

View GitHub Profile
"C:\Program Files\Ventuz Technology Group\Ventuz 6\VentuzPresenter.exe" "C:\Users\Public\Documents\Ventuz6\Content\Projects\ds_experimental.scenes_experimental\trunk\repos_for_dummies_training\repos_for_dummies_training.vzp" -log:0 -default:/City_Ranking
@DevinThompson
DevinThompson / Swift Change color of single word
Last active December 18, 2019 00:00
Change the color of a single word in an attributed text string
// Change the color of one word
upperTextView.headerLabel.textColor = .textGray
if let text = upperTextView.headerLabel.text {
if let range = text.range(of: "style")?.nsRange(in: text) {
(text as NSString).substring(with: range)
if let myString = upperTextView.headerLabel.attributedText {
let mutable = NSMutableAttributedString(attributedString: myString)
mutable.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.white, range: range)
upperTextView.headerLabel.attributedText = mutable
let blurRadius = 9.0
let asset = AVAsset(url: videoURL)
//MAKE IT BLURRED
playerItem.videoComposition = AVVideoComposition(asset: asset) {request in
let mutated = request.sourceImage.clampedToExtent().applyingFilter("CIColorPosterize").applyingGaussianBlur(sigma: blurRadius)
let output = mutated.clamped(to: request.sourceImage.extent)
request.finish(with: output, context: nil)
}
@DevinThompson
DevinThompson / High Quality Gif Helpers
Created February 19, 2019 18:46
An easy way to create gif palettes from video for higher quality gifs
//Create a gif with these params
ffmpeg -ss 2.6 -t 1.3 -i ARBBall.mp4 -i palette.png -filter_complex “fps=15,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse” sixthtry.gif
//create a palette from the same location in the video
ffmpeg -ss 2.6 -t 1.3 -i ARBBall.mp4 -vf fps=15,scale=320:-1:flags=lanczos,palettegen palette.png