Skip to content

Instantly share code, notes, and snippets.

View MadMaxMcKinney's full-sized avatar

Max McKinney MadMaxMcKinney

View GitHub Profile
@MadMaxMcKinney
MadMaxMcKinney / PlayerController.cs
Created May 9, 2017 19:08
A simple 2D player controller with instant movement and mouse tracking using a rigidbody for physics checks including rotation.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed = 5f;
private Rigidbody2D rb;
@MadMaxMcKinney
MadMaxMcKinney / smooth-yellow-gist.css
Last active April 10, 2017 23:42
A syntax highlighting theme for use with embeded gists based off of Smooth Yellow: https://github.com/MaxMcKinney/Smooth-Yellow-Theme
.gist .pl-e, .gist .pl-en {
color: #FD971F !important;
}
.gist .pl-c1, .gist .pl-s .pl-v {
color: #B4C2D6 !important;
}
.gist .pl-s, .gist .pl-pds, .gist .pl-s .pl-pse .pl-s1, .gist .pl-sr, .gist .pl-sr .pl-cce, .gist .pl-sr .pl-sre, .gist .pl-sr .pl-sra {
color: #B4C2D6 !important;
@MadMaxMcKinney
MadMaxMcKinney / ubuntuUsefulCLICommands.md
Last active March 23, 2017 15:52
Ubuntu Useful CLI Commands

View installed PPA Repository with a .sh script

#! /bin/sh 
# listppa Script to get all the PPA installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
 echo sudo apt-add-repository ppa:$USER/$PPA
@MadMaxMcKinney
MadMaxMcKinney / restart-xorg
Created March 23, 2017 00:50
Restart XORG Ubuntu
sudo systemctl restart lightdm
@MadMaxMcKinney
MadMaxMcKinney / 51-synaptics-quirks.conf
Created March 23, 2017 00:49
Disable touchpad while typing on XPS 13 running Ubuntu. Add this section to /usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf
# Disable generic Synaptics device, as we're using
# "DLL0704:01 06CB:76AE Touchpad"
# Having multiple touchpad devices running confuses syndaemon
Section "InputClass"
Identifier "SynPS/2 Synaptics TouchPad"
MatchProduct "SynPS/2 Synaptics TouchPad"
MatchIsTouchpad "on"
MatchOS "Linux"
MatchDevicePath "/dev/input/event*"
Option "Ignore" "on"
@MadMaxMcKinney
MadMaxMcKinney / npmUsefulPackages.md
Last active February 17, 2017 15:49
A list of useful npm packages to have for basic front end development

Browserify

"Browserify lets you require('modules') in the browser by bundling up all of your dependencies." npm install -g browserify

browserify main.js -o bundle.js

Express

"Easy node webservers. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications."

var express = require('express')
@MadMaxMcKinney
MadMaxMcKinney / gitUsefulCommands.md
Last active February 16, 2017 17:13
git - Useful Commands

Annotated tag

git tag -a v1.4 -m "my version 1.4"

Push tag to remote

git push origin *tag*

View branches

@MadMaxMcKinney
MadMaxMcKinney / npmUsefulCommands.md
Last active February 16, 2017 17:13
npm - Useful Commands

List all globally installed npm packages

npm list -g --depth=0

View outdated global packages only

npm outdated -g --depth=0

Update global packages

@MadMaxMcKinney
MadMaxMcKinney / ColorConverter.cs
Last active June 15, 2016 17:52
A UWP Windows 10 C# helper class designed to help with basic operations of setting and getting colors. By default there is no simple way to set a Color object from a HEX value. This will provide an easy solution. More features will follow as I run into problems.
public static class ColorConverter
{
public static Color GetColorFromHex(string hex)
{
hex = hex.Replace("#", string.Empty);
byte a = (byte)(Convert.ToUInt32(hex.Substring(0, 2), 16));
byte r = (byte)(Convert.ToUInt32(hex.Substring(2, 2), 16));
byte g = (byte)(Convert.ToUInt32(hex.Substring(4, 2), 16));
byte b = (byte)(Convert.ToUInt32(hex.Substring(6, 2), 16));
Color c = Color.FromArgb(a, r, g, b);
// backup settings to be used