Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
⌨️

Max Glenister omgmog

⌨️
View GitHub Profile
@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);
@omgmog
omgmog / .js
Last active May 7, 2016 19:45
Simple THREE.js thing constructor
// So that we can call .apply() on a new constructor
var construct = function (constructor, args) {
function F() {
return constructor.apply(this, args);
}
F.prototype = constructor.prototype;
return new F();
};
// Constructor for a new THREE thing...
@omgmog
omgmog / gulpfile.js
Created October 15, 2015 09:36
sass/postcss magic
var gulp = require('gulp');
var sass = require('gulp-sass');
var cssc = require('gulp-css-condense');
var postcss = require('gulp-postcss');
var pixrem = require('gulp-pixrem');
// Process Sass to CSS
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
@omgmog
omgmog / userstyle.css
Created September 10, 2015 15:39
Improved layout for www.theinquirer.net
@-moz-document domain("www.theinquirer.net") {
@media screen {
#content-left-main {
background: #fff;
}
#leftcol,
#rightcol,
#centercol,
.inq_left_block,
.inq_right_block {