Skip to content

Instantly share code, notes, and snippets.

View abutler3's full-sized avatar

Andrew Butler abutler3

  • Solider of Fortune, Member of The A Team, nephew of B.A. Baracus
  • Nashville, TN
View GitHub Profile
@abutler3
abutler3 / hashtag_question.rb
Created February 18, 2013 15:43
Getting a Bad Authentication data error
# Failure/Error: click_button 'Search'
# Twitter::Error::BadRequest:
# Bad Authentication data
# searches_controller.rb
class SearchesController < ApplicationController
def create
redirect_to search_path(params[:twitter][:search])
end
@abutler3
abutler3 / anatomy-backbone.js
Created February 25, 2013 23:42
Backbone.js walkthough
// an Appointment model class.
var Appointment = Backbone.Model.extend({});
// Appointment model class, let's create our first instance and assign it to the appointment variable.
//Pass in a title for the appointment when creating it.
var appointment = new Appointment();
// set the title of the appointment instance! Set it to any string
appointment.set('title', 'My knee hurts');
// we have our very first appointment. But it isn't so useful, sitting there deep down in the bowels of your browser.
//To display it lets first create a view class and name it AppointmentView
var AppointmentView = Backbone.View.extend({
@abutler3
abutler3 / anatomy-backbone-models.js
Created February 28, 2013 01:52
Models examples
// Our Appointment model doesn't seem too useful yet. Add two default attributes,
// title as the string "Checkup", and date which should default to the current time new Date()
var Appointment = Backbone.Model.extend({
defaults: {
title: "Checkup",
date: new Date()
}
});
//While messing around in the console, you've discovered a strange bug. Every new Appointment you create has the same exact date, instead of the date and time of when the Appointment instance was created.
@abutler3
abutler3 / gist:de6d9227f12999a8c7b4
Last active August 29, 2015 14:08
Creatng json for specialities dropdown jsfiddle is http://jsfiddle.net/L8etkgqh/
var doctorsFilter = angular.module('findADoc', []);
doctorsFilter.controller('doctorsController', ['$scope', '$http', function($scope, $http) {
$http.get('../css/findadoc.json').success(function(data) {
$scope.doctors = data;
});
$scope.options = {
stores: [
{id :"Cart", name : 'Ma commande', speciality: 'Ma commande'},
This file has been truncated, but you can view the full file.
{"Provider":[{"ID":"18934","ProviderName":{"FirstName":"Vandana","MiddleName":"Gupta","LastName":"Abramson","Prefix":"Dr.","Suffix":{},"PreferredName":{},"FormerLastName":{}},"Gender":"Female","BirthDate":"0001-01-01T00:00:00","Status":"Active","ImageUrl":"https:\/\/apd.mc.vanderbilt.edu\/ProviderImages\/Abramson Vandana Gupta-18934.jpg","Verified":"true","WhenVerified":"2014-07-21T08:58:32","TakesAppointments":"true","TitlesList":{"ProviderTitle":{"ID":"19","Title":"Assistant Professor of Medicine"}},"EducationList":{"ProviderEducation":{"Degree":"MD","Description":"Doctor of Medicine","Institution":"University of Chicago","GraduationYear":"2000"}},"PostGraduateTrainingList":{"ProviderPostGraduateTraining":[{"PostGraduateTrainingType":"Fellowship","Institution":"University of Pennsylvania","StartYear":{},"EndYear":"2006"},{"PostGraduateTrainingType":"Residency","Institution":"Brigham and Women's Hospital - Harvard Medical School","StartYear":{},"EndYear":"2003"}]},"BoardCertificationsList":{"ProviderBoardCer
@abutler3
abutler3 / gist:34080a684322b8da8cdb
Created February 17, 2015 21:40
Show and hide ng-repeat in angular practice
<!DOCTYPE html>
<html ng-app="MyApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My AngularJS App</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
require 'date'
puts Date.today.to_s
puts " _ _ "
puts " | | | | "
puts " _ __ _ __ ___ __| |_ _ ___| |_ ___ "
puts "| '_ \\| '__/ _ \\ / _` | | | |/ __| __/ __|"
puts "| |_) | | | (_) | (_| | |_| | (__| |_\\__ \\"
puts "| .__/|_| \\___/ \\__,_|\\__,_|\\___|\\__|___/"
puts "| | "
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt')
OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
class puphpet_php (
$php,
$mailhog
) {
include ::php::params
class { 'puphpet::php::settings':
version_string => $php['settings']['version'],
}
vagrantfile:
target: local
vm:
provider:
local:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
box_version: '0'
chosen_virtualizer: virtualbox
virtualizers: