Skip to content

Instantly share code, notes, and snippets.

@teknikqa
teknikqa / responsive.html
Created January 28, 2012 04:27 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@teknikqa
teknikqa / downloadFileChunks.php
Last active November 3, 2015 12:46 — forked from irazasyed/downloadFileChunks.php
PHP: File downloader function - Downloading files in chunks.
<?php
/**
* Download helper to download files in chunks and save it.
*
* @author Syed I.R <syed@lukonet.com>
* @link https://github.com/irazasyed
*
* @param string $srcName Source Path/URL to the file you want to download
* @param string $dstName Destination Path to save your file
* @param integer $chunkSize (Optional) How many bytes to download per chunk (In MB). Defaults to 1 MB.
@teknikqa
teknikqa / .htaccess
Last active April 3, 2016 12:15 — forked from tomschlick/gist:1397070
Conditional htpasswd. htaccess declarations to set password for only certain files.
#allows a single uri through the .htaccess password protection
SetEnvIf Request_URI "/testing_uri$" test_uri
#allows everything if its on a certain host
SetEnvIf HOST "^testing.yoursite.com" testing_url
SetEnvIf HOST "^yoursite.com" live_url
Order Deny,Allow
AuthName "Restricted Area"
AuthType Basic
@teknikqa
teknikqa / new-drupal-dev-vm.sh
Created February 2, 2016 11:22 — forked from rgoodie/new-drupal-dev-vm.sh
A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm), augments configuration (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
# new drupal vagrant install
# A function, when added to bash profile, clones the Vagrant Drupal-Dev-VM (https://github.com/geerlingguy/drupal-dev-vm),
# augments config (based on d7 or d8), renames the VM to something other than drupaltest.dev and starts vagrant up. Uses
# include <newd 7 my-drupal-site> and <newd 8 my-other-drupal-site>.
function newd {
if [ $2 == ]; then
echo 'USAGE: newd8 <version> <sitename>'
@teknikqa
teknikqa / policy.drush.inc
Created April 11, 2016 07:14 — forked from shrop/policy.drush.inc
Sample Drush policy file
<?php
/**
* @file
* Drush policies to restrict what is allowed for certain drush commands.
*/
/**
* Prevent production databases from being overwritten using drush sql-sync.
*/
@teknikqa
teknikqa / logs
Created July 21, 2016 12:10 — forked from heathdutton/logs
Get Acquia enterprise logs from a quick command line shell
#!/bin/bash
# Retrieves past and present logs for a site in Acquia Enterprise
# Put this in your /usr/local/bin folder and chmod it 0755
# Then you can search/view logs quickly from any terminal
if [ "$1" = "" ] || [ "$2" = "" ]
then
echo "Retrieves past and present logs for a site in Acquia Enterprise"
echo "Usage: $0 <site-alias> <site-environment>"
echo "Example: $0 qrk test"
@teknikqa
teknikqa / 50_purge_varnish.sh
Created July 21, 2016 13:09 — forked from heathdutton/50_purge_varnish.sh
Acquia Cloud hook for flushing Varnish .com domains securely.
#!/bin/bash
#
# Cloud Hooks: code-deploy, code-update, db-copy, web-activate
# Essentially any time code or db changes are made.
#
# Purges Varnish cache for all .com domains assigned to the environment in Acquia Cloud.
site="$1"
target_env="$2"
drush_alias=$site'.'$target_env
@teknikqa
teknikqa / gist:5c9b5367d32fb6ad66cc20303c46f384
Created July 21, 2016 13:24 — forked from heathdutton/gist:cc29284de3934706acd1
Start an Acquia drush command, and wait for it to complete before continuing.
#!/bin/bash
# Runs an acquia task, and waits for the task to complete before continuing.
# This is a helper script, to be used in others as needed.
if [[ $1 = "" ]] || [[ $2 = "" ]]
then
echo "Runs an acquia drush command, waiting for the results before continuing."
echo "Can be used as a replacement for drush."
echo
echo " Usage: $0 <site-alias> <ac-drush-command>"
@teknikqa
teknikqa / autokey-acquia.sh
Created January 22, 2017 13:26 — forked from nhoag/autokey-acquia.sh
Auto-handling of ssh keys for Acquia Hosting
#!/bin/bash
# Acquia
CLOUDAPI_ID='id'
CLOUDAPI_KEY='key'
DOCROOT="docroot"
CREDS="${CLOUDAPI_ID}:${CLOUDAPI_KEY}"
ssh-keygen -q -b 4096 -t rsa -N "" -f ./script.key
@teknikqa
teknikqa / html.tpl.php
Created October 18, 2017 11:46 — forked from pascalduez/html.tpl.php
Drupal 7 — Move $scripts at page bottom
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>