Skip to content

Instantly share code, notes, and snippets.

View wndxlori's full-sized avatar

Lori M Olson wndxlori

View GitHub Profile
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active June 2, 2024 12:48
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@vhorb
vhorb / capybara_config.rb
Last active December 18, 2023 11:36
Capybara register new driver for test
# Typically this faile named capybara.rb and needed for browser configuration.
# This file related to capybara 3.22.0 and webdriver 3.8.0
require 'capybara/rspec'
require 'capybara-screenshot/rspec'
require 'webdrivers'
Capybara.register_driver :context_selenium_chrome do |app|
chrome_args = %w[window-size=1920,1080]
@connorshea
connorshea / tasks.jsonc
Created April 20, 2019 01:18
VS Code `tasks.json` file for DragonRuby Game Toolkit, drop it in `.vscode/tasks.json` in the dragonruby folder and then open the Command Palette (Ctrl/Cmd + Shift + P), choose "Run task", and then choose your task :) Should work on macOS and Linux, not sure about Windows.
{
// tasks.json for dragonruby samples
"version": "2.0.0",
"tasks": [
{
"label": "doomwipe",
"type": "shell",
"command": "./dragonruby samples/doomwipe/",
"problemMatcher": []
},
@amirrajan
amirrajan / rm-live-reload.md
Last active April 14, 2021 15:40
Interim Solution for Live Reload of RubyMotion Apps

Interim Solution for Live Reload of RubyMotion Apps

  1. Install rerun: gem install rerun.
  2. Add ./live_reload.rb with the following contents:
# gem install rerun
# gem install readline
# gem install open3
# gem install open3
@dchersey
dchersey / pre-commit
Last active October 27, 2016 20:33
commit hook to detect presence of rubymotion logging statements
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='^[^#]*mp[^a-zA-Z0-9]'
# CHECK
if test $(git diff --cached | grep $consoleregexp | grep + | wc -l) != 0
then
@jadonk
jadonk / README.md
Last active May 1, 2022 21:36
Installing mjpg-streamer
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active April 25, 2021 02:17
Loop through Jekyll collections and output their content as sections and articles
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@jbender
jbender / simulators.rb
Created February 23, 2016 19:35
RubyMotion simulate all OS/device combos
{
:iphone_4 => 'iPhone 4s',
:iphone_5 => 'iPhone 5',
:iphone_6 => 'iPhone 6',
:iphone_6_plus => 'iPhone 6 Plus',
:ipad => 'iPad Retina',
:ipad_air => 'iPad Air'
}.each do |rake_task, device|
default_task = "bundle exec rake device_name=\"#{device}\""
@orta
orta / _SQL.sql
Last active November 8, 2016 12:12
Top 300 Pods by Application Integrations
SELECT pods.name, stats_metrics.download_total, stats_metrics.download_week, stats_metrics.app_total, stats_metrics.app_week FROM stats_metrics JOIN pods ON stats_metrics.pod_id = pods.id ORDER BY app_total DESC LIMIT 300;
@jacklynrose
jacklynrose / openstruct.rb
Created May 23, 2014 09:55
Half implementation of OpenStruct
class OpenStruct < BasicObject
def initialize(hash)
@struct = ::Struct.new(*hash.keys.map { |k| k.to_sym })
@struct = @struct.new(*hash.values)
end
def ==(other)
to_h == other.to_h
end