Skip to content

Instantly share code, notes, and snippets.

View MadMaxMcKinney's full-sized avatar

Max McKinney MadMaxMcKinney

View GitHub Profile
@MadMaxMcKinney
MadMaxMcKinney / materialcolors.xml
Created June 12, 2015 15:15
Material Design Colors (Android XML)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="material_red50">#ffffebee</color>
<color name="material_red100">#ffffcdd2</color>
<color name="material_red200">#ffef9a9a</color>
<color name="material_red300">#ffe57373</color>
<color name="material_red400">#ffef5350</color>
<color name="material_red500">#fff44336</color>
<color name="material_red600">#ffe53935</color>
<color name="material_red700">#ffd32f2f</color>
@MadMaxMcKinney
MadMaxMcKinney / Android_TabListner.java
Created December 31, 2012 20:41
Android 3.0+ TabListener.
private class TabListener<T extends Fragment> implements
ActionBar.TabListener {
private Fragment mFragment;
private final Activity mActivity;
private final String mTag;
private final Class<T> mClass;
// Constructor - set the variables up from when you call the method somewhere else
public TabListener(Activity activity, String tag, Class<T> clz) {
mActivity = activity;
@MadMaxMcKinney
MadMaxMcKinney / DiceRoll.java
Created July 10, 2013 14:17
###Daily Programmer - July 10th 2013 User input in the form of 'ndm' where n is the number of dice, and m is the number of faces.
import java.util.Scanner;
public class DiceRoll {
public static void main(String[] args) {
// Get the java console scanner. Allows the user to type into the console.
Scanner s = new Scanner(System.in);
// Pull the contents from what the user said. Split the array at the "d".
// The input will look like ex: 4d10
// Returns 4, 10 to the String array 'in'.
@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);
@MadMaxMcKinney
MadMaxMcKinney / bohemianRhapsody
Created November 2, 2013 03:52
Describe song via code.
try
{
Assert(Life.Real);
Assert(Life.Fantasy);
}
catch(LandSlideException ex)
{
#region Reality
while(true)
{
@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 / 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')
// backup settings to be used
@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"