Skip to content

Instantly share code, notes, and snippets.

View adeolaawoyemi's full-sized avatar
🏠
Working from home

Adeola Awoyemi adeolaawoyemi

🏠
Working from home
  • Yahoo
  • San Jose, CA
View GitHub Profile

Install ffmpeg with ALL includes

brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')

Cut video from 00:00:43 sec to 00:00:58 sec (15 sec duration).
Resize it to 720p.
Max quality options, but small size.

MP4

With audio:

@adeolaawoyemi
adeolaawoyemi / branch-name-from-jira-ticket.js
Last active June 2, 2021 18:30
Bookmarklet JavaScript for creating a git branch name from a Jira ticket in the format of `feature-TICKET-1234-some_desciption`
javascript:(function(){function copyToClipboard(a){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",a);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var b=document.createElement("textarea");b.textContent=a,b.style.position="fixed",document.body.appendChild(b),b.select();try{return document.execCommand("copy")}catch(a){return console.warn("Copy to clipboard failed.",a),!1}finally{document.body.removeChild(b)}}};copyToClipboard(('feature-' + document.querySelector('a#key-val.issue-link').innerText + '-' + document.querySelector('h1#summary-val.editable-field.inactive').innerText).replace(/ /g, '_').replace(/\[|\]|\.|'|"|>/g,''));})()
@adeolaawoyemi
adeolaawoyemi / devmode-console-helper.js
Created October 1, 2018 08:02 — forked from onestepcreative/devmode-console-helper.js
Color code your console log messages with a shorter syntax to console.log and easily turn off console logging by setting a DEV_MODE variable to false.
/*
Author: Josh McDonald
Twitter: @onestepcreative
Website: joshmcdonald.net
A simple helper to log color coded messages to the
javascript console, using a shorter syntax to console.log
You can leave your dev.log() statements scattered throughout
@adeolaawoyemi
adeolaawoyemi / apple-notes-evernote.scpt
Created September 26, 2018 08:47
AppleScript to migrate from Apple Notes to Evernote.
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
set myTitle to the name of thisMessage
set myText to the body of thisMessage
@adeolaawoyemi
adeolaawoyemi / getParams.js
Created May 31, 2017 08:08
Get query string Params from a URL
var getParams = function (url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
var countryCodesMap = {
"ad": "and",
"ae": "are",
"af": "afg",
"ag": "atg",
"ai": "aia",
"al": "alb",
"am": "arm",
"ao": "ago",
"aq": "ata",
@adeolaawoyemi
adeolaawoyemi / org.virtualbox.plist
Created November 26, 2013 14:46
When starting up a vagrant vm on Mac OS X Mavericks, you may get errors like "VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory" as described in this stackoverflow thread: http://bit.ly/1ennuVK. So I don't have to do it every time I restart, I created a launchd item to d…
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.virtualbox</string>
<key>ProgramArguments</key>
<array>
<string>/Library/StartupItems/VirtualBox/VirtualBox</string>
<string>restart</string>
@adeolaawoyemi
adeolaawoyemi / konami-debug.js
Last active December 20, 2015 01:59
Debugger opened using the Konami code
/* -----------------------------*/
/* Debugging */
// Show d(ebug)alerts only when in DEBUG mode
window.dalert = function (a, b, c, d) {
if (window.ALLOW_DEBUG) window.alert(a, b, c, d);
};
window.dtitle = function (a) {
if (window.ALLOW_DEBUG) document.title=a;
};
$(function () {
<?xml version="1.0"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*" />
</cross-domain-policy>
@adeolaawoyemi
adeolaawoyemi / gist:4075859
Created November 15, 2012 00:37
String.inArray() method
String.prototype.inArray = function(arr) {
for (var i = arr.length - 1; i >= 0; i--) {
if (arr[i] == this.toString()) return true;
};
return false;
};
"dick".inArray(["tom", "dick", "harry"]); // true