Skip to content

Instantly share code, notes, and snippets.

View DanisHack's full-sized avatar
:octocat:

Muhammad Danish DanisHack

:octocat:
View GitHub Profile
@DanisHack
DanisHack / gist:ea3ec1f91336ffb8a026c168b570fba4
Created March 18, 2021 15:57 — forked from eviltester/gist:7beef92896fdd8b638656f996fac38c0
Convert videos into subtitled sections using ffmpeg
# Create a new caption file
~~~~~~~~
ffmpeg -i captions.srt captions.ass
~~~~~~~~
# Add subtitles to main video without changing it
~~~~~~~~
ffmpeg -i video.mp4 -vf "subtitles=captions.ass:force_style='OutlineColour=&H80000000,BorderStyle=4,Outline=1,Shadow=0,MarginV=20'" subtitled-video.mp4
@DanisHack
DanisHack / bootstrapping.md
Created January 30, 2021 18:27 — forked from dideler/bootstrapping.md
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

@DanisHack
DanisHack / dataURItoBlob.js
Created August 25, 2020 01:21 — forked from davoclavo/dataURItoBlob.js
Convert dataURI to Blob so large images do not crash the browser. Based on: http://stackoverflow.com/questions/10412299 and http://stackoverflow.com/questions/6850276
/*
The MIT License (MIT)
Copyright (c) 2016 David Gomez-Urquiza
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
@DanisHack
DanisHack / package.json
Created August 6, 2020 15:52 — forked from mallendeo/package.json
Record gsap animations frame by frame with puppeteer
{
"name": "gsap-to-video",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"fs-extra": "^7.0.0",
"puppeteer": "^1.7.0"
}
}
@DanisHack
DanisHack / generate-silence.sh
Created May 27, 2020 16:13 — forked from daz/generate-silence.sh
Generate a silent AAC audio with ffmpeg
ffmpeg -f lavfi -i anullsrc=r=11025:cl=mono -t <number of seconds> -acodec aac out.m4a
@DanisHack
DanisHack / background.js
Created April 7, 2020 15:03 — forked from muralikg/background.js
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@DanisHack
DanisHack / greeting.scala
Created October 17, 2019 00:00
Sample Scala code
class Greeting {
def Greet() {
println("Hello from Educative!");
}
}
object Main extends App {
var obj = new Greeting();
obj.Greet();
}
@DanisHack
DanisHack / greeting.java
Last active October 17, 2019 00:04
Java sample code
class Greeting {
public void Greet() {
System.out.println("Hello from Educative!");
}
}
class HelloWorld {
public static void main( String args[] ) {
Greeting obj = new Greeting();
obj.Greet();
@DanisHack
DanisHack / mvnInstaller.sh
Created December 23, 2018 20:49 — forked from gonaumov/mvnInstaller.sh
Bash script for installation of latest maven.
#!/bin/bash
set -x
declare -r apacheMavenDownloadUrl="http://apache.cbox.biz/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz"
declare -r directoryName="mvn/"
if [[ $apacheMavenDownloadUrl =~ ([^/]+)\-bin\.tar\.gz$ ]]
then
declare -r resultFileName=$BASH_REMATCH
declare -r resultDirectoryName=${BASH_REMATCH[1]}