Skip to content

Instantly share code, notes, and snippets.

View josephbales's full-sized avatar

Joseph Bales josephbales

View GitHub Profile
@josephbales
josephbales / LAMP_SETUP_OLD.md
Created October 16, 2015 21:09
How to set up a LAMP stack in VIrtualBox... old instructions.

#Setting Up a Development LAMP Stack: ##Using Windows, VirtualBox, and Ubuntu

This document describes how to set up a development LAMP stack using a host Windows machine, VirtualBox, and Ubuntu Server 12.04.

###Step 1: Setting up the host machine

  • Create a shared folder on the host machine. This can be anywhere. I placed mine in my documents folder.
  • Edit your hosts file as Administrator
    • Right click on Notepad or your editor of choice and select Run as Administrator
  • On Windows navigate to C:\Windows\System32\drivers\etc and open the hosts file
@josephbales
josephbales / gist:0d2560e8487a5b882fd2
Last active January 11, 2016 19:38
Material design test
<!DOCTYPE html>
<html>
<head>
<title>Test File</title>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.green-blue.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Uses a transparent header that draws on top of the layout's background -->
<style>
@josephbales
josephbales / transform.xsl
Created January 14, 2016 22:01
XSLT to convert Wordpress RSS feed to HTML
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<xsl:output omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="channel">
<!DOCTYPE html>
<html>
<head>
<title>Test File</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.green-blue.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!DOCTYPE html>
<html>
<head>
<title>Test File</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.green-blue.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
@josephbales
josephbales / trim_db_cols.sql
Last active September 19, 2016 18:49
Trim all columns in a database T-SQL
-- Replace <DATABASE> with the name of your database
-- May also need to change the DATA_TYPE inside the cursor to fit your schema
DECLARE @TABLENAME NVARCHAR(255)
DECLARE @SQL NVARCHAR(MAX)
DECLARE db_cursor CURSOR FOR
SELECT TABLE_NAME
FROM <DATABASE>.INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"default_line_ending": "unix",
"fade_fold_buttons": false,
"font_size": 14,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
#!/bin/bash
git config --global user.name "Joseph Bales"
git config --global user.email [email protected]
git config --global core.editor vim
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.st status
@josephbales
josephbales / pandigital.cs
Created September 5, 2017 17:06
Pandigital Helpers in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
@josephbales
josephbales / weightgurus.py
Created May 28, 2019 12:23 — forked from MarkWalters-dev/weightgurus.py
Access data collected by your Greater Goods Weight Gurus scale
#!/usr/bin/env python3
# So I asked Greater Goods if they would point me in the direction of their API. So I could get data
# from their WiFi scale without the limitations of their Weight Gurus app. They said they don't give
# that out. So my options are to return the scale to Amazon because it is useless to me without an
# API or I figure it out myself. Anyway, I figured it out so you don't have to return your scale.
# This isn't an API but from here you can atleast access the data.
# If you don't already have the scale you can find it on Amazon
# UPC 875011003964