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
Given an array of integers, can you find the sum of its elements?
Input Format
The first line contains an integer, , denoting the size of the array.
The second line contains space-separated integers representing the array's elements.
Output Format
Print the sum of the array's elements as a single integer.
// If variable is an array
// If array has all numbers
// is this a photo stored in the site (for a Person node)?
// if so, we can use Image Styles to generate the different sizes needed
if(strpos($photo_uri,"public:") === 0){
$regular = image_style_url($preset,$photo_uri);
$retina = image_style_url($preset . "_2x",$photo_uri);
$img_properties = image_get_info(image_style_path($preset, $photo_uri ));
$photo_height = $img_properties['height'];
$photo_width = $img_properties['width'];
} else {
// We have to explicitly specify the dimensions for photos coming from the photo services feed
https://acquia-academy.gitbooks.io/study-guide-drupal-8-site-builder-exam/content/study-guide.html
http://www.tanay.co.in/blog/cracking-acquia-certified-drupal-site-builder-certification.html
https://www.4sitestudios.com/blog/when-to-use-content-types-taxonomies-and-custom-entities-in-drupal
What are blocks?
- https://www.drupal.org/docs/8/core/modules/block/overview
- https://www.drupal.org/docs/user_guide/en/block-concept.html
- Blocks are individual pieces of your site’s web page layout.
vagrantfile:
target: local
vm:
provider:
local:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
box_version: '0'
chosen_virtualizer: virtualbox
virtualizers:
class puphpet_php (
$php,
$mailhog
) {
include ::php::params
class { 'puphpet::php::settings':
version_string => $php['settings']['version'],
}
#!/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)
require 'date'
puts Date.today.to_s
puts " _ _ "
puts " | | | | "
puts " _ __ _ __ ___ __| |_ _ ___| |_ ___ "
puts "| '_ \\| '__/ _ \\ / _` | | | |/ __| __/ __|"
puts "| |_) | | | (_) | (_| | |_| | (__| |_\\__ \\"
puts "| .__/|_| \\___/ \\__,_|\\__,_|\\___|\\__|___/"
puts "| | "
@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>
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: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'},