Skip to content

Instantly share code, notes, and snippets.

View marshall007's full-sized avatar

Marshall Cottrell marshall007

View GitHub Profile
#!/bin/bash
# Usage:
# airport off
# airport on
# airport reset
# get current wifi device
CURRENT_DEVICE=$(networksetup -listallhardwareports | awk '$3=="Wi-Fi" {getline; print $2}')
echo "Current Wi-Fi Device: '$CURRENT_DEVICE'"
@marshall007
marshall007 / timeAgo.coffee
Last active December 20, 2015 00:09
AngularJS "Time Ago" filter.
timeAgo = angular.module 'app'
# Filter: time
# Date.parse() is inconsistent across browsers
# this is a shim for parsing ISO-8601 date strings
timeAgo.filter 'time', ->
(time) ->
@marshall007
marshall007 / gist:5887542
Created June 28, 2013 19:50
AngularJS loading indicator.
ACTIVE_CLASS = 'active'
ERROR_CLASS = 'ng-error'
SUCCESS_CLASS = 'ng-ok'
angular.module('app')
.config([ '$httpProvider', ($httpProvider) ->
$el = angular.element document.getElementById 'loading'
$httpProvider.responseInterceptors.push 'LoadingIndicator'
$httpProvider.defaults.transformRequest.push (data, headersGetter) ->
var inject_script = function(source) {
if (!source) source = "//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.js";
var script = document.createElement("script");
script.src = source;
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
var listen = setInterval(function() {

Shahid Shah

CEO, Netspective

Slides

Health Data Integration Complexity

  • The kinds of data that are most interesting.
  • Pitfalls
// -------------------------------------------------------
// Roots global settings variables
// -------------------------------------------------------
// font options (add your own!)
helvetica-neue = "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif
helvetica = "Helvetica Neue", Helvetica, Arial, sans-serif
georgia = Georgia, Cambria, "Times New Roman", Times, serif
lucidia-grande = "Lucida Grande", Tahoma, Verdana, Arial, sans-serif
monospace = unquote("'Bitstream Vera Sans Mono', Consolas, Courier, monospace")
@marshall007
marshall007 / gist:5119874
Created March 8, 2013 21:11
selecting min and max values while avoiding multiple enumerations.
var tests = dbTests.Select(t => new TestSearchable
{
Price = t.LabTests.Select(l => l.ListPrice)
.GroupBy(l => 0)
.Select(l => new Dictionary<string, int>
{
{ "High", l.Max() },
{ "Low", l.Min() }
}).First(),
TurnAround = t.LabTests.SelectMany(l => new[] { l.EstimatedTatLow, l.EstimatedTatHigh })
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
</head>
<body>
<div id="video" style="width: 854px; height: 480px;" ></div>
<div id="footnote"></div>
</body>
@marshall007
marshall007 / config.json
Created October 18, 2012 15:53 — forked from michaelcpuckett/simplest-express-setup-ever.js
Use any folder on localhost:3000 (for development)
{
"watch":
{ "extensions": ["html", "htm", "js", "css", "less", "json"]
, "exclude": ["node_modules/", ".git/"] }
, "chrome":
{ "debugging_port": 9222
, "app_path": "/Applications/Google\\ Chrome.app" }
}
import hashlib
salt = hashlib.sha256("salt").hexdigest()[:5]
password = "yep"
calculated_hash = hashlib.sha256(password + salt).hexdigest()
print [salt, calculated_hash]
# password: yep