Skip to content

Instantly share code, notes, and snippets.

View bbrewer97202's full-sized avatar

Ben Brewer bbrewer97202

View GitHub Profile
@bbrewer97202
bbrewer97202 / gist:7240988
Created October 30, 2013 21:52
Common Android emulator commands + keyboard shortcuts I am always trying to remember
### commands
#start the avd manager
$ ./android avd
#list available avds
$ ./android list avd
#Start an emulator with a target avd:
$ ./emulator -avd <avdname>
@bbrewer97202
bbrewer97202 / gist:7161113
Created October 25, 2013 20:11
Add/Update a hosts file on Android SDK emulator
$ adb remount
$ adb pull /system/etc/hosts tmp/hosts
$ vi tmp/hosts
$ adb push tmp/hosts /system/etc
@bbrewer97202
bbrewer97202 / index.html
Last active December 26, 2015 04:19
Icon font implementation with MSHPIconsRegular web font
<!doctype html>
<html>
<head>
<title>MSHPIconsRegular</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//i.s-microsoft.com/fonts/segoe-ui/west-european/normal/latest.css" />
</head>
<body>
<style type="text/css">
@bbrewer97202
bbrewer97202 / index.html
Created October 7, 2013 19:00
angularjs select ng-option example with keys and values from object
<!doctype html>
<html ng-app="selectExample">
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script src="select.js" type="text/javascript"></script>
</head>
<body>
<div ng-controller="selectController">
@bbrewer97202
bbrewer97202 / gist:6687433
Created September 24, 2013 16:34
Get Full URL of page in C# without query string
Response.Write(new Uri(HttpContext.Current.Request.Url.AbsoluteUri).GetLeftPart(UriPartial.Path));
@bbrewer97202
bbrewer97202 / gist:5699204
Created June 3, 2013 16:03
cookie access via javascript starter
var cookie = {
//session cookies
setCookie: function(name, value) {
document.cookie = name + "=" + escape(value) + ';path=/';
},
getCookie: function(name) {
var key, val;
var cookies = document.cookie.split(";");
var cookiesLength = cookies.length;
for (var i=0; i < cookiesLength; i++) {
@bbrewer97202
bbrewer97202 / gist:5068302
Created March 1, 2013 22:09
Locked header + footer HTML page with two columns of scrolling content in between (tested iOS6 across orientation change).
<!doctype html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<style type="text/css" media="screen">
html,body {
@bbrewer97202
bbrewer97202 / css3pulsingcirle
Created September 18, 2012 18:06
Simple CSS3 pulsing circle animation
<html>
<head>
<title></title>
</head>
<body>
<div id="pulser">
<div class="pulse pulse1"></div>
<div class="pulse pulse2"></div>
<div class="pulse pulse3"></div>
@bbrewer97202
bbrewer97202 / heroku-htaccess.md
Created August 10, 2012 18:20
Simple htaccess authentication on Heroku with cedar/php

Create an .htaccess file in the webroot:

AuthUserFile /app/www/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user

Create a .htpasswd file:

htpasswd -c /app/www/.htpasswd [username]