Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
⌨️

Max Glenister omgmog

⌨️
View GitHub Profile
@omgmog
omgmog / jekyll-to-grav.js
Last active February 4, 2019 09:05
Port Jekyll posts to Grav CMS
const fs = require('fs');
const glob = require('glob');
const fm = require('front-matter');
const path = require('path');
const write = require('write');
glob("!(node_modules)/**/*.md", {}, (err, files) => {
files.forEach((file) => {
fs.readFile(file, 'utf8', (err, data) => {
if (err) throw err;
@omgmog
omgmog / gist.user.js
Last active September 15, 2017 11:23
// ==UserScript==
// @name Close and open url
// @namespace https://omgmog.net
// @version 0.1
// @description close issue and open first link from issue
// @author Max Glenister
// @match https://github.com/omgmog/meta-ifttt-reading-list/issues/*
// @grant none
// ==/UserScript==
@omgmog
omgmog / open-all-the-issues.user.js
Created July 31, 2017 15:09
Open all of the issues in new tabs when clicking a link of `href="open10"`
// ==UserScript==
// @name Open all the issues
// @namespace https://blog.omgmog.net/
// @version 0.1
// @description Opens all of the issues on the current page in new windows
// @author You
// @match https://github.com/*/*/issues
// @grant none
// ==/UserScript==
@omgmog
omgmog / VRUXUI.md
Last active August 24, 2023 14:06
This is mirrored from the now unavailable http://vruxui.com/video-gallery

Click an image below to view the video on Youtube.

VRPlanetarium

Menu Interactions

Environment

@omgmog
omgmog / audio-processing.sh
Last active February 20, 2019 18:41
Audio processing bash functions for OSX
# Convert mp3 files to wav
# Usage: for file in *.mp3; do mp3towav $file; done
mp3towav() {
afconvert -f WAVE -d LEI16@44100 "$1"
}
# Trim silence from start/end of files
# Usage: for file in *.wav; do trimsilence $file; done
trimsilence() {
mkdir -p trimmed
var arr = [];
arr[100] = 'Foo';
// Outputs lots of 'undefined' and then the value for arr[100]
for (var i=0;i<arr.length;i++) {
console.log(arr[i]);
}
// Outputs just the indexes with a value defined
var imgDefer = document.getElementsByTagName('img');
for (var i=0; i<imgDefer.length; i++) {
if(imgDefer[i].getAttribute('data-src')) {
imgDefer[i].setAttribute('src',imgDefer[i].getAttribute('data-src'));
}
}
@omgmog
omgmog / userstyle.css
Created January 27, 2016 10:30
Bigger "cinema" mode on Youtube
#body .watch-stage-mode .player-height {
height: 760px;
}
#body .html5-video-player {
overflow: visible!important;
}
#body .html5-video-player video {
width: 1280px!important;
height: 720px!important;
left: -213px!important;
@omgmog
omgmog / postcss-nope.js
Created December 23, 2015 15:46
Nope for PostCSS
var postcss = require('postcss');
module.exports = postcss.plugin('postcss-nope', function (opts) {
opts = opts || {};
return function (css) {
css.eachDecl(function transformDecl(decl) {
decl.value = decl.value.replace('nope', 'none');
});
};
@omgmog
omgmog / .js
Created December 8, 2015 11:43
Grab urls and names of custom emojis on Slack
// While viewing the page, run this from the developer console.
var emojislist=[];
for (var i = 0; i<emojis.length;i++) {
var text = emojis[i].querySelectorAll('td:nth-child(2)')[0].innerText;
var img = emojis[i].querySelectorAll('td:nth-child(1) span')[0].getAttribute('data-original');
emojislist.push({text:text,img:img});
}
console.log(emojislist);