Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffery Bennett Meandmybadself

View GitHub Profile
@Meandmybadself
Meandmybadself / join.js
Created Sep 1, 2017
Joins movies in a directory using ffmpeg.
View join.js
const fs = require('fs')
const dir = process.argv[2]
const txtFilename = 'files.txt'
const outputFilename = 'output.mp4'
const { exec } = require('child_process')
let output = ''
const files = fs.readdirSync(dir).filter(f => (
f !== '.DS_Store' &&
f !== outputFilename &&
@Meandmybadself
Meandmybadself / index.html
Created Jan 8, 2017
Basic HTML template.
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<link rel="shortcut icon" href="/assets/images/favicon.ico" type="image/x-icon" >
<link rel="stylesheet" href="">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
@Meandmybadself
Meandmybadself / Dockerfile
Created Dec 11, 2016
Elasticsearch Dockerfile
View Dockerfile
FROM elasticsearch:latest
#install some useful plugins
RUN mkdir /tmp/es-plugins && \
for i in \
'hq','https://codeload.github.com/royrusso/elasticsearch-HQ/zip/master' \
'kopf','https://codeload.github.com/lmenezes/elasticsearch-kopf/zip/master' \
'esi','https://codeload.github.com/polyfractal/elasticsearch-inquisitor/zip/master' \
'head','https://codeload.github.com/mobz/elasticsearch-head/zip/master' \
'bigdesk','https://codeload.github.com/lukas-vlcek/bigdesk/zip/master' \
@Meandmybadself
Meandmybadself / dedupe-images.php
Last active Dec 11, 2016
Dedupes a directory of images using their md5 hash.
View dedupe-images.php
<?php
$dir = "./";
$deleteCt = 0;
$hashes = array();
$d = @dir($dir) or die("getFileList: Failed opening directory $dir for reading");
View exportjson.js
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@Meandmybadself
Meandmybadself / utilitybelt.js
Last active Nov 12, 2015
JavaScript utility belt
View utilitybelt.js
//A continual schmorgasboard of code that probably exists in a better documented & executed function elsewhere.
//Produces a # between min and max.
function between(min,max) {
var d = Math.abs(min - max);
return min + Math.random() * d;
}
//Integer between min & max.
function intBetween(min,max) {
View setup-dev.sh
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
View config.js
{
"version":"1.0",
"description":"Basic statement of work",
"ui":{
"projectTitle":{"label":"Project Title", "default":"Fart"}
}
}
@Meandmybadself
Meandmybadself / c5-nginx.conf
Created Mar 17, 2015
Concrete5 + NGINX conf
View c5-nginx.conf
server {
listen 80;
server_name domain.com;
root /var/www/html/;
index index.html index.htm index.php;
access_log /var/log/nginx/domain_access.log main;
error_log /var/log/nginx/domain_error.log debug;
@Meandmybadself
Meandmybadself / downloads.sh
Created Jan 16, 2015
Organize Downloads / rsync to seedbox
View downloads.sh
#!/bin/bash
DOWNLOADS="~/Downloads/"
MEDIA=$DOWNLOADS/_Media
#Seedbox deets.
SEEDBOX_USER="seedbox_username"
SEEDBOX_HOST="seedbox.hostname.com"
SEEDBOX_PATH="~/watch"