Skip to content

Instantly share code, notes, and snippets.

View vijayantkatyal's full-sized avatar

Vijayant Katyal vijayantkatyal

View GitHub Profile
@vijayantkatyal
vijayantkatyal / css-zoom.js
Created June 8, 2020 09:17 — forked from Nemo64/css-zoom.js
A polyfill for the zoom css property in firefox. The element that is zoomed must not have a margin though!
// this is a hacky and brutal polyfill to somewhat implement zoom in firefox
// https://caniuse.com/#feat=css-zoom
// it allows to use jQuery's $('.element').css({zoom: 1.5});
// there is no effort to actually implement a normal css polyfill
// this polyfill also doesn't work when the zoomed element has margins since they are used to fake the new size.
$.cssNumber.zoom = true;
if (!("zoom" in document.body.style)) {
$.cssHooks.zoom = {
get: function(elem, computed, extra) {
@vijayantkatyal
vijayantkatyal / profile.json
Last active April 11, 2023 22:53
Windows Terminal Color Schema
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@vijayantkatyal
vijayantkatyal / ffmpeg_docs
Last active August 9, 2019 04:35
ffmpeg links
Notes:
> use ffmpeg as native tool in OS (without using any third party library)
> create transport streams (ts) for better conversion and quality and speed
> use good CPU with GPU power
> run multiple ffmpeg instances in parallel
> AWS lambda for creating videos
Links:
@vijayantkatyal
vijayantkatyal / live.sh
Created May 6, 2017 09:29
Live Video Stream to Facebook
# stream video
ffmpeg -re -i live.mp4 -c:v libx264 -preset veryfast -maxrate 3000k \
-bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 \
-ar 44100 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/"
# stream desktop
ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 -ar 44100 -f alsa -ac 2 -i hw:0 -preset ultrafast output.mp4 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/"
@vijayantkatyal
vijayantkatyal / backup.php
Created December 1, 2016 15:56
Create Backup of folders and database
<?php
// create folder
$backupfile = 'dest_folder_name/file_name_' . date("Y-m-d") . '.tar.gz';
system("tar -czf $backupfile src_folder");
// database backup
$dbhost = "localhost"; // usually localhost
$dbuser = "user_name";
@vijayantkatyal
vijayantkatyal / run_docker
Last active November 28, 2016 00:00
run docker in current directory
// create image (in working directory)
docker run -v "$(pwd):/usr/src/app" -p "4000:4000" starefossen/github-pages
// run container
docker start -i blog
@vijayantkatyal
vijayantkatyal / xbox_retro_pie
Created July 25, 2016 16:27
install xbox one controller driver on retro pie
# Get rpi-source... easier than dkms shenanigans with headers from here
# https://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
# Clean anything from a previous install
sudo rm -rfv /usr/src/4.4.11-v7
sudo install bc
@vijayantkatyal
vijayantkatyal / package_sources_example.config
Last active September 6, 2015 19:22
package source example
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2/" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<disabledPackageSources />
<activePackageSource>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</activePackageSource>