Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Always Working

Thomas Hunsaker thunsaker

💻
Always Working
View GitHub Profile
@thunsaker
thunsaker / miloshadzic-alt.zsh-theme
Created Nov 19, 2019
Alternate Version of the Miloshadzic zsh theme
View miloshadzic-alt.zsh-theme
# Yay! High voltage and arrows!
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} '
@thunsaker
thunsaker / .slate
Last active Feb 11, 2019
Slate config that doesn't take over all of my keyboard shortcuts.
View .slate
# Slate: https://github.com/jigish/slate
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Push Bindings
bind right:ctrl;cmd push right bar-resize:screenSizeX/2
bind left:ctrl;cmd push left bar-resize:screenSizeX/2
bind up:ctrl;cmd push up bar-resize:screenSizeY
@thunsaker
thunsaker / LineEntry.cs
Last active Sep 17, 2018 — forked from davidtavarez/LineEntry.cs
Xamarin.Forms Entry just with bottom border. Added IsValid and ErrorColor Properties to better handle Validation Scenarios
View LineEntry.cs
using System;
using Xamarin.Forms;
namespace YOURNAMESPACE
{
public class LineEntry : Entry
{
public static BindableProperty BorderColorProperty =
BindableProperty.Create(
@thunsaker
thunsaker / git-hub-ribbon-custom.html
Created Sep 2, 2011
GitHub Custom Ribbon in CSS
View git-hub-ribbon-custom.html
<!-- Add to the <head> section -->
<style type="text/css">
.git-ribbon {
background-color: #a00;
overflow: hidden;
/* top left corner */
position: absolute;
left: -3em;
top: 2.5em;
/* 45 deg ccw rotation */
@thunsaker
thunsaker / weather
Created Mar 9, 2017
Alias for wttr.in which only displays today's weather
View weather
alias weather='curl "http://wttr.in/[YOUR CITY HERE]" -s | head -7'
@thunsaker
thunsaker / C Mobile Browser Redirect.cs
Created Feb 11, 2011
C# Code to detect most mobile browsers and redirect to another page.
View C Mobile Browser Redirect.cs
string u = Request.ServerVariables["HTTP_USER_AGENT"];
Regex b = new Regex(@"android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", RegexOptions.IgnoreCase | RegexOptions.Multiline);
Regex v = new Regex(@"1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im
@thunsaker
thunsaker / atom-sane-tab-switching.cson
Last active Dec 31, 2016
Atom - Sane Tab Switching
View atom-sane-tab-switching.cson
# Add the following to your keymap.cson file
#
# Get to keymap.cson through Settings -> Keybindings or ~/.atom/keymap.cson (on Mac)
'body':
'ctrl-tab':'pane:show-next-item'
'ctrl-shift-tab':'pane:show-previous-item'
@thunsaker
thunsaker / android_build_types.gradle
Last active Nov 20, 2016
Common build.gradle snippets for Android
View android_build_types.gradle
// Android debug/release build types including package renaming for debug
android {
buildTypes {
debug {
zipAlign true
debuggable true
runProguard false
packageNameSuffix ".debug"
versionNameSuffix "-debug"
signingConfig signingConfigs.debugSigning
@thunsaker
thunsaker / modernizr-ios-check.js
Last active Apr 27, 2016 — forked from danott/modernizr-tests.js
Custom Modernizr tests that are useful.
View modernizr-ios-check.js
/* modernizr-ios-check.js
* Daniel Ott (with modifications)
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@thunsaker
thunsaker / timeline.js
Last active Feb 17, 2016
Small JS sample to push pins from inside a PebbleKit JS app
View timeline.js
/******************************* timeline lib *********************************/
// The timeline public URL root
var API_URL_ROOT = 'https://timeline-api.getpebble.com/';
/**
* Send a request to the Pebble public web timeline API.
* @param pin The JSON pin to insert. Must contain 'id' field.
* @param type The type of request, either PUT or DELETE.
* @param topics Array of topics if a shared pin, 'null' otherwise.