Skip to content

Instantly share code, notes, and snippets.

var synth = window.speechSynthesis;
synth.cancel() // Cancel the synth everytime so all event can be fired. this is a bug on webkit which stop firing event /// https://stackoverflow.com/questions/23483990/speechsynthesis-api-onend-callback-not-working
function speak(text) {
if (synth.speaking) {
console.error("speechSynthesis.speaking");
return;
}
if (text !== "") {
var utterThis = new SpeechSynthesisUtterance(text);
utterThis.onend = function (event) {
@Sonukr
Sonukr / Custom seekbar on video
Last active July 12, 2021 11:55
This is a custom seekbar based on start and duration from a long video. this custom seekbar will be for that duration and get finished during the duration not on original video duration, seeking will be seeked based on exact video time.
<!DOCTYPE html />
<!--
Author: Sonu
-->
<html>
<head>
<title>HTML 5 Video play with custom control</title>
<meta charset="UTF-8" />
<style id="jsbin-css">
.main{
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@Sonukr
Sonukr / sketch-never-ending.md
Created March 22, 2019 18:27 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@Sonukr
Sonukr / Fetch all git branch
Created February 7, 2019 15:27
Fetch all git branch on local
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@Sonukr
Sonukr / CSV_Parser.js
Last active August 10, 2018 09:16
CSV Parser which will return parsed data as array. you can pass your own strDelimiterArg to override existing one.
// Constants
const ZERO = 0;
const ONE = 1;
const TWO = 2;
const THREE = 3;
// Main Function
export const csvToArray = (strData, strDelimiterArg) => {
// Check to see if the delimiter is defined. If not,
// then default to comma.
@Sonukr
Sonukr / stystem.sh
Last active November 22, 2021 09:13
#Give execute permission to your script:
# chmod +x /path/to/yourscript.sh
# And to run your script:
# /path/to/yourscript.sh
# if permission denied for homebrew run the following command
# sudo chown -R $(whoami):admin /usr/local && sudo chmod -R g+rwx /usr/local
# Since . refers to the current directory: if yourscript.sh is in the current directory, you can simplify this to:
@Sonukr
Sonukr / Galaxy Of Tutorial Torrents
Last active August 29, 2015 14:28 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html