Skip to content

Instantly share code, notes, and snippets.

@aczietlow
aczietlow / php55.rb
Created July 7, 2014 14:15
Chef cookbook to install php 55 on Ubuntu
#
# Author:: Adar Porat(<adar.porat@gmail.com>)
# Cookbook Name:: php55
# Attribute:: default
##
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@aczietlow
aczietlow / reinstall.sh
Last active August 29, 2015 14:05
Reinstall local Drupal site.
#!/bin/bash
# Place rebuild script in the project root.
# From a terminal run '. reinstall.sh <development_database_name>'
# WARNING: Will completely drop the database.
cd ./www
drush sql-drop -y
if [ -z $1 ]; then
echo 'Please provide name of database to import.'
@aczietlow
aczietlow / drupal_sandbox_test.sh
Created October 6, 2014 22:12
Install module for testing using latest version of Drupal 7.
#!/bin/bash
# Download latest Drupal 7 and enable module to test.
if [ -z $1 ]; then
echo 'Please provide a module to include in the sandbox.'
return
fi
@aczietlow
aczietlow / overridingVisibility.php
Created November 20, 2014 15:49
Accessing super class private variables
<?php
Class MyClass {
private $string = 'Can\'t touch this!';
public function doStuff() {
$this->string = $this->string . ' Na Na Na Na.';
}
}
@aczietlow
aczietlow / debugging_efq.php
Last active August 29, 2015 14:15
Debug entity field queries in Drupal
<?php
function MYMODULE_query_alter($query) {
if ($query->hasTag('efq_debug') && module_exists('devel')) {
dsm((string) $query);
dsm($query->arguments());
}
}
$query = new EntityFieldQuery;
$group_entities = $query->entityCondition('entity_type', 'node')
@aczietlow
aczietlow / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aczietlow
aczietlow / .bash_profile.sh
Created September 8, 2015 18:51
git.sh shell prompt
#https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
GIT_PS1_SHOWUPSTREAM='verbose'
export PS1="[\u@\h:\W]\`__git_ps1\` \$ "
@aczietlow
aczietlow / gist_tool_chain.md
Created November 25, 2015 03:19
Tools Im using to work with gists

Gist Toolchain

Editor - Atom

  • I like atom better. It's faster, has better real time markdown rendering

Edit gists from github

@aczietlow
aczietlow / droplet.js
Created October 30, 2013 21:33
droplet.js from spyderbytedesign
jQuery(document).ready(function($) {
var width = window.innerWidth;
function hideNodes(active) {
$(".view-front-page-drop-block .node-page").hide();
$(active).show();
}
$(window).resize(function() {
@aczietlow
aczietlow / forms.inc
Created November 18, 2013 19:49
ada_corporatejoin/includes/forms.inc
@@ -164,48 +164,25 @@ function _ada_corporatejoin_form_submit_infusionsoft($form_state) {
}
function _ada_corporatejoin_form_submit_payment(&$form_state) {
- if (module_exists('google_checkout') && $form_state['values']['payment']['method']['options'] == 'credit_card') {
+ if (module_exists('ada_paypal_api') && $form_state['values']['payment']['method']['options'] == 'credit_card') {
global $user;
- google_checkout_load_include('item');
- $cart = google_checkout_cart_init();