Skip to content

Instantly share code, notes, and snippets.

View sinameraji's full-sized avatar

Sina Meraji sinameraji

View GitHub Profile
@maximebories
maximebories / convert.md
Last active November 28, 2025 22:08
FFmpeg command to convert webm to mp4 video files

WebM to MP4 using FFmpeg

This FFmpeg command converts a .webm video file to a standard .mp4 file using the libx264 codec for video, aac codec for audio, and a CRF value of 22. The preset is set to 'slow' for higher quality encoding, and the audio bitrate is set to 128 kbps.

If the input and output filenames don't contain spaces, quotation marks or other special characters:

ffmpeg -i input.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 128k output.mp4
@et0and
et0and / worker.js
Created July 14, 2020 09:02
Cloudflare Worker to map custom domain onto a Notion page
const MY_DOMAIN = 'example.com';
/*
* Enter your Notion URL slug to page ID mapping
*/
const SLUG_TO_PAGE = {
'': '771ef38657244c27b9389734a9cbff44',
};
const PAGE_TITLE = '';
@leon-sleepinglion
leon-sleepinglion / compound_interest_calculator.py
Created March 16, 2018 14:39
Coding for Economist Minds - Week 1
#-------------------------------------------------------------------
# This is a compound interest calculator, along with some challenge
# Written by Leon Wee, March 2018.
# Anyone may freely copy or modify this program.
#-------------------------------------------------------------------
# C = P[(1+r)^n - 1]
# Where:
# C = the compound interest
# P = the principal investment amount (the initial deposit or loan amount)
@yjzhang
yjzhang / k_means.py
Last active February 9, 2024 21:04
basic python implementation of k-means and online k-means clustering
# Online k-means algorithm
# see http://www.cs.princeton.edu/courses/archive/fall08/cos436/Duda/C/sk_means.htm
import numpy as np
def k_means(data, k, threshhold=2):
"""
Does k-means clustering of the data.
Args:
@sturmen
sturmen / mp4_to_webm.sh
Created May 12, 2017 18:15
Conversion Script from MP4 to WebM in good quality
#!/bin/sh
set -ex
for i in *.mp4; do
ffmpeg -y -i "$i" -c:v libvpx-vp9 -pass 1 -b:v 2M -crf 30 -threads 8 -speed 4 \
-pix_fmt yuv420p -tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
ffmpeg -i "$i" -c:v libvpx-vp9 -pass 2 -b:v 2M -crf 30 -threads 8 -speed 2 \
@lmcneel
lmcneel / remove-node-modules.md
Last active November 5, 2025 11:41
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@ebraminio
ebraminio / maktabkhooneh.js
Last active April 5, 2021 07:53
maktabkhooneh
// https://maktabkhooneh.org/course/%D9%85%D8%A8%D8%A7%D9%86%DB%8C-%D8%A7%D9%82%D8%AA%D8%B5%D8%A7%D8%AF-mk170/
[...document.querySelectorAll('a.chapter__unit')]
.map(x => () => fetch(x.href)
.then(x => x.text())
.then(x => new DOMParser().parseFromString(x, 'text/html').querySelector('meta[property="og:video"]').content)
.then(y => console.log(y, x.children[1].innerText.trim().replace(/\s/g, '_') + '.mp4'))
)
.reduce((promise, next) => promise.then(next), Promise.resolve())
.then(() => console.log('Finished!'));
@PurpleBooth
PurpleBooth / README-Template.md
Last active December 10, 2025 21:19
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites