Skip to content

Instantly share code, notes, and snippets.

@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 / gist:7337098
Created November 6, 2013 14:41
extract command
# extract: Extract most know archives with one command
# ---------------------------------------------------------
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
@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();
@aczietlow
aczietlow / icon example
Created December 3, 2013 23:03
example of fontawesome icon
<html>
<head>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
</head>
<body>
<p><span class="fa fa-camera-retro fa-lg"></span> fa-camera-retro</p>
</body>
</html>
@aczietlow
aczietlow / vhost
Last active April 9, 2023 14:26
apache 2.4 vhost example
<VirtualHost *:80>
ServerName {zietlow.dev}
ServerAlias {*.zietlow.dev}
DocumentRoot {/home/aczietlow/Sites/zietlow/dev/www}
# Optional per project error logging.
ErrorLog {/home/aczietlow/Sites/zietlow/dev/zietlow.log}
<Directory {/home/aczietlow/Sites/zietlow/dev/www/}>
Options Indexes FollowSymLinks MultiViews
@aczietlow
aczietlow / my.cnf
Created December 10, 2013 21:19
local mysql config
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# ***Insecure: For local environment only ***
#skip-networking
bind-address = 127.0.0.1
#socket = /var/mysql/mysqld.sock
@aczietlow
aczietlow / compare.sh
Created January 28, 2014 21:24
compare 2 git branches for commits missing from 1 branch
MASTER=`git log --pretty=format:'%H' 2014-01-14-fixes | sort`
DEV=`git log --pretty=format:'%H' master | sort`
for i in `diff <(echo "${MASTER}") <(echo "${DEV}") | grep '^>' | sed 's/^> //'`;
do
git --no-pager log -1 --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short $i;
echo ""
done
@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 / selenium-php-webdriver-cheatsheet.md
Last active March 6, 2024 22:48 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

@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.'