Skip to content

Instantly share code, notes, and snippets.

🦄
React'ing.

Robert Moggach robmoggach

🦄
React'ing.
Block or report user

Report or block robmoggach

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robmoggach
robmoggach / ffmpeg-html5
Last active Oct 17, 2019 — forked from yellowled/ffmpeg-html5
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
View ffmpeg-html5
#!/usr/bin/env bash
FULLFILE="$1"
FILENAME=$(basename "$FULLFILE" | cut -d. -f1)
# webm
for size in 640x360; do
ffmpeg -i $FULLFILE -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s ${size} ${FILENAME}-${size}.webm
done
@robmoggach
robmoggach / importSVGFilesAsLayers.js
Created May 30, 2014
Illustrator script to import a folder of SVG files into separate offset layers
View importSVGFilesAsLayers.js
// Import SVG Files as Layers - Illustrator CS3 script
// Description: Imports a folder of SVG files as named layers into a new document
// Author: Robert Moggach (rob@moggach.com)
// Version: 0.0.1 on 2014-05-29
function getFolder() {
return Folder.selectDialog('Please select the folder to be imported:', Folder('~'));
}
@robmoggach
robmoggach / ease.js
Created Jul 17, 2019
After Effects Easing Functions
View ease.js
function easeExpo(beginValue, endValue, duration, offset) {
t = time - offset;
if (t < 0) return beginValue;
if (t > duration) return endValue;
if (beginValue.constructor == Array) {
x = 0;
y = 0;
z = 0;
if (beginValue.length == 2) {
x = easeExpo(beginValue[0], endValue[0], duration, offset);
@robmoggach
robmoggach / overclock_nvidia.sh
Created Nov 20, 2017
overclock nvidia bash script
View overclock_nvidia.sh
#!/usr/bin/env bash
DEFAULT_FAN=65
DEFAULT_MEM=1500
DEFAULT_GPU=150
DEFAULT_POW=200
echo "Setting up ${GPU_COUNT} GPU(s)..."
GPU_COUNT="$(nvidia-smi -L | wc -l)"
@robmoggach
robmoggach / gulpfile.js
Last active Jan 24, 2019
mediumra.re gulpfile for insight and pipeline themes...
View gulpfile.js
/* eslint-disable */
// REQUIRE STATEMENTS
const fs = require('fs'),
path = require('path'),
gulp = require('gulp'),
pixrem = require( 'gulp-pixrem' ),
log = require('fancy-log'),
newer = require('gulp-newer'),
runSequence = require('run-sequence'),
sass = require('gulp-sass'),
@robmoggach
robmoggach / webfaction_gitlab.md
Last active Oct 1, 2018
Webfaction GitLab Install
View webfaction_gitlab.md

Install Gitlab on webfaction

November 2014

I wanted to install gitlab on my shared hosting server at webfaction and here's how I did it. Be warned it's a memory hog. I couldn't get it below 450Mb. Also... this is for their newer 64 bit servers. I tried on a 32 bit server and didn't want to waste a day tracking down dependencies.

Create app for gitlab

Create a new app (using python)

@robmoggach
robmoggach / profitcoin.py
Created Nov 16, 2017
python script to return currently most profitable coins to mine
View profitcoin.py
#!/usr/bin/env python
import urllib2
import json
import argparse
SRC_META = {
'whattomine': {
'url': "https://whattomine.com/coins.json",
'sort_key': 'profitability',
View nucamio.py
import math
import os
import re
import json
from pprint import pprint
from collections import OrderedDict
from operator import add
import maya.cmds as cmds
import maya.mel as mel
@robmoggach
robmoggach / RRM_utils.py
Created Feb 19, 2018 — forked from evitolins/RRM_utils.py
Maya Python Snippets
View RRM_utils.py
'''
This fixes a RRM bug (v1.4.7) where saved RRM setups do not preserve a
module's 'pinned' status.
'''
import maya.cmds as cmds
import maya.mel
def RRM_fixPinBug(objs):
for obj in objs:
trans = cmds.xform(obj,q=True, r=True, translation=True)
maya.mel.eval("RRM_PinProxies(1, 0);")
@robmoggach
robmoggach / font_convert.py
Created May 8, 2013
Python script to convert a hierarchy of fonts to OTF format This is useful if you have a huge collection of mac fonts that use resource forks and want cross platform fonts. Use at your own risk. It's not fully tested. Backup your originals before you run the script to be safe. It requires the fontforge python library.
View font_convert.py
#!/usr/bin/python
import os, sys, string, re, MacOS
from string import capwords
import fontforge as ff
from optparse import OptionParser
TEST = False
SKIP_FILES = ['.DS_Store', '.AppleDB', 'convert_font.log', 'Icon?']
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
You can’t perform that action at this time.