Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
| var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i; | |
| var loadImage = function (file) { | |
| var reader = new FileReader(); | |
| reader.onload = function(e){ | |
| var img = document.createElement('img'); | |
| img.src = e.target.result; | |
| var range = window.getSelection().getRangeAt(0); | |
| range.deleteContents(); |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| #!/bin/bash | |
| compose_file_path=$1 | |
| project_name=$2 | |
| backup_path=$3 | |
| function backup_volume { | |
| volume_name=$1 | |
| backup_destination=$2 |
| Linux: | |
| google-chrome --disable-web-security | |
| Windows: | |
| 1) Right click on desktop, add new shortcut | |
| 2) Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp | |
| ex on Windows 10 : | |
| "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp |
| -- original code: https://github.com/ericelliott/cuid | |
| -- Add the "plv8" extension | |
| create extension if not exists "plv8"; | |
| -- Add the "pgcrypto" extension | |
| create extension if not exists "pgcrypto"; | |
| \dx | |
| -- Connect a database |
| import 'package:flutter/material.dart'; | |
| import 'package:get/get.dart'; | |
| void main() { | |
| runApp(GetMaterialApp( | |
| initialRoute: '/login', | |
| getPages: [ | |
| GetPage( | |
| name: '/login', | |
| page: () => LoginPage(), |
| <script> | |
| let s = 0; | |
| let m = 0; | |
| let active = false; | |
| let timer; | |
| function setActive(a) { | |
| active = a; | |
| if(!active) { | |
| clearInterval(timer) |
| # admin | |
| from django import admin | |
| from django.db import models | |
| from widget import TextareaWithCounter | |
| class MyModelAdmin(admin.ModelAdmin): | |
| formfield_overrides = { | |
| models.TextField: {'widget': TextareaWithCounter}, | |
| } | |
| class Media: |
| # mount volume PWD on host to /app in container. | |
| shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml | |
| version: "3" | |
| services: | |
| some_server: | |
| ... | |
| volumes: | |
| - $PWD:/app |