Skip to content

Instantly share code, notes, and snippets.

@untergrundbiber
untergrundbiber / oauth.sh
Last active February 3, 2022 20:49
YouTube OAuth Bash
#!/bin/bash
#YouTube OAuth authentication for shell-based YT-tools like youtube-dl
#by untergrundbiber 2014
#You need to register a app to obtaining clientId and clientSecret.
#https://developers.google.com/youtube/registering_an_application
#You can find the right scope here: https://developers.google.com/oauthplayground/
#--- Settings ---
clientId="000000000000.apps.googleusercontent.com"
@callmephilip
callmephilip / gist:3519403
Created August 29, 2012 21:52
[JavaScript] Dispatching keyboard event
// gecko and webkit
// details here https://developer.mozilla.org/en-US/docs/DOM/event.initKeyEvent
var keyboardEvent = document.createEvent("KeyboardEvent");
var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
keyboardEvent[initMethod](
"keydown", // event type : keydown, keyup, keypress
true, // bubbles