Skip to content

Instantly share code, notes, and snippets.

View greylurk's full-sized avatar

Adam Ness greylurk

View GitHub Profile
#!/bin/bash
set b="N"
while [ $b != "Y" ]; do
echo "Do thing 2? (Y/N)"; read a
if [ "$a" == "N" ]; then
echo "Doing Thing 1"
else
echo "Doing Thing 2"
fi
@greylurk
greylurk / 01-instructions.md
Last active June 20, 2017 19:06
Assuming the Data Science Role

Installing

  1. Setup the AWS CLI and add an spscommerce profile with your Dev aws credentials
$ aws configuration add --profile spscommerce
  1. Add the functions.sh to your home directory
  2. Add the following to your ~/.bashrc file
@greylurk
greylurk / docker_compose.yml
Created January 14, 2016 22:40
A very simple public docker_compose.yml for testing purposes
web:
image: nginx:latest
/**
* @license Angulartics v0.19.2
* (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics
* Universal Analytics update contributed by http://github.com/willmcclellan
* License: MIT
*/
(function(angular) {
'use strict';
/**
// Check the install instructions for https://github.com/GreyGnome/EnableInterrupt
#include <EnableInterrupt.h>
// Modify this at your leisure. Refer to https://github.com/GreyGnome/EnableInterrupt/wiki/Usage#Summary
#define MOMENTARY_SWITCH 10
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
class StupidMath():
def __init__(self, number):
self.number = number
def __add__(self, other):
return repr(self.number - other.number) + repr(self.number+other.number)
def __repr__(self):
return str(self.number)
print "{} + {} = {}".format(StupidMath(10), StupidMath(3), StupidMath(10) + StupidMath(3))
Key verification failure! at /var/local/cur8/lib/perl5/Cur8/SpamFilter.pm line 15.
Compilation failed in require at /var/local/cur8/lib/perl5/Cur8/MasonPackages.pm line 125.
BEGIN failed--compilation aborted at /var/local/cur8/lib/perl5/Cur8/MasonPackages.pm line 125.
Compilation failed in require at /var/local/cur8/lib/perl5/Cur8/Mason.pm line 18.
BEGIN failed--compilation aborted at /var/local/cur8/lib/perl5/Cur8/Mason.pm line 18.
Compilation failed in require at (eval 3) line 3.
@greylurk
greylurk / app.js
Created January 20, 2014 16:37
angular app
'use strict';
// Declare app level module
var widgetSlider = angular.module('widgetSlider', []);
widgetSlider.directive("foo", [ "$log", function( $log ) {
return {
restrict: "E",
template: "<div ng-bind='values'></div><bar />",
controller: function($scope) {
# Most normal settings
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
try:
execfile(os.path.join("/etc/project", "settings_local.py"))
except IOError:
execfile(os.path.join(SITE_ROOT, 'settings_local.py'))
@greylurk
greylurk / gist:2416699
Created April 18, 2012 21:27
Inheritance sample
from django.db import models
class Profile(models.Model):
title = models.CharField(max_length=200)
class UserProfile(Profile):
user = models.OneToOneField('auth.user')
class OrganizationProfile(Profile):
users = models.ManyToManyField('auth.user')