Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffery Bennett Meandmybadself

View GitHub Profile
@Meandmybadself
Meandmybadself / export-databases.php
Last active Aug 29, 2015
Export mySQL databases via PHP
View export-databases.php
<?php
//In the event that PHP / mySQL is set up funkily.
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
ini_set('display_errors', '1');
//Fill these in.
$host = '';
$username = '';
$password = '';
View gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
app: {
devDir: './app',
distDir: './dist'
},
clean: {
dist:['<%= app.distDir %>']
},
View boilerplate.html
<!DOCTYPE html>
<html lang='en'>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
<meta name="description" content="" />
<meta name="keywords" content="" />
<!-- fb -->
View gist:9f546e4bc13741ede58e
### Keybase proof
I hereby claim:
* I am meandmybadself on github.
* I am meandmybadself (https://keybase.io/meandmybadself) on keybase.
* I have a public key whose fingerprint is 0A33 C8A8 9D60 A9CF FAFF 103B C1BB 1B59 DE76 ABC0
To claim this, I am signing this object:
@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"
View config.js
{
"version":"1.0",
"description":"Basic statement of work",
"ui":{
"projectTitle":{"label":"Project Title", "default":"Fart"}
}
}
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
@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 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 / 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");