Skip to content

Instantly share code, notes, and snippets.

View leo424y's full-sized avatar

Fly Chang leo424y

View GitHub Profile
@gvoze32
gvoze32 / ffmpeg mp3 to mp4.MD
Last active November 10, 2024 18:53
Convert mp3 audio to MP4 using ffmpeg in terminal.

To convert audio mp3 to MP4 by ffmpeg, use the following command

ffmpeg -f lavfi -i color=c=black:s=1280x720:r=5 -i audio.mp3 -crf 0 -c:a copy -shortest output.mp4

Description

This generates mp4 formatted video with blank black background with the color source filter instead of using an image.

Since it is just black video this is one case with lossless mode (-crf 0) will have a smaller file size than the default lossy mode.

@DavidColby
DavidColby / slider.html
Created May 6, 2021 22:12
Implementation of a horizontal slider component with Stimulus and Tailwind CSS
<!--
This code is meant to accompany the guide originally published at https://colby.so/posts/building-a-horizontal-slider-with-stimulus-and-tailwind
It intentionally pulls in Tailwind CSS and Stimulus without a build system to simplify the guide. You shouldn't do this with a real application,
you should use a build system like webpack!
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@leo424y
leo424y / Capistrano_Installation_Manual.md
Created July 7, 2020 08:53 — forked from amolkhanorkar/Capistrano_Installation_Manual.md
Deployment Of ROR application with Capistrano By Using Remote Database Server

Deployment Of ROR application with Capistrano By Using Remote Database Server**

Steps To Deploy Application:

Prerequisites : 1. Ruby Installation Firstly install rvm using following command

Install dependencies

$ sudo apt-get install curl
@einichi
einichi / export-keep.js
Last active May 1, 2022 18:02
Exports Google Keep notes to CSV (text only), run in JS console when on keep.google.com
var elements = document.getElementsByTagName("*"); // Grab all elements, since the actual note content elements have no ID are seemingly randomly generated class IDs
var keepTitle = [];
var keepContent = [];
var x = 0;
for (var i=0; i < elements.length; i++) { // Loop through all elements
if (elements[i].hasAttribute("contenteditable") && elements[i].getAttribute("contenteditable") == "false") { // Elements with 'contenteditable' attr set to false in the Keep page are fortunately only note title and contents
if (x % 2 == 0) { // Simple means of separating title from contents
if (elements[i].innerHTML == "") { // Make it clear if the field was empty
keepTitle.push("(empty)");
}
@sivers
sivers / podcast.rb
Created October 29, 2019 21:30
Podcast RSS generator in Ruby
#!/usr/bin/env ruby
require 'date'
require 'xml'
def htmlit(infile)
lines = File.readlines(infile)
/<!--\s+(.+)\s+-->/.match lines.shift
lines.unshift('<h2>%s</h2>' % $1)
html = ''
lines.each do |line|
@kirillshevch
kirillshevch / rails_new_options_help.md
Last active October 31, 2024 14:00
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
@mayneyao
mayneyao / notion2blog.js
Last active September 14, 2024 01:22
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@bazzel
bazzel / README.md
Last active May 26, 2021 04:20
Rails 6 and Bootstrap 4

This blogpost shows how to setup Rails 6 with Bootstrap 4.

This snippet shows a somehow different and less customized approach.

$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js expose-loader