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

Keybase proof

I hereby claim:

  • I am teknikqa on github.
  • I am teknikqa (https://keybase.io/teknikqa) on keybase.
  • I have a public key whose fingerprint is 2DF7 6C8B 02F3 92F7 885B 6D14 0F8E 60C9 55D0 5294

To claim this, I am signing this object:

<?php
/**
* This script will initialize the fields for controlling research and publications
* with the default value for all users. This field was added later and so this
* step is necessary.
*
* Run this script only if email notifications are disabled or if reroute email
* is enabled.
*
@teknikqa
teknikqa / purge-cache.sh
Last active April 3, 2016 12:20
Script to manually purge the cache on Acquia load balancers. It can accept a path that needs to be purged from the cache.
#!/usr/bin/env bash
#
# This script will purge the Varnish cache on Acquia for the given URLs
# Requires cURL
#
# Usage purge-cache.sh <url>
# Author: Nick Mathew <nm7.org>
# Date: 2016-04-03
#
@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 / drupal-clear-cache-sql.sh
Last active July 17, 2016 08:34
Clear all caches in Drupal using SQL
#!/usr/bin/env bash
# Clear cache of the following tables using the Drush SQL command
# The SQL commands can also be used directly in MySQL
drush sql-cli
TRUNCATE TABLE cache;
TRUNCATE TABLE cache_block;
TRUNCATE TABLE cache_bootstrap;
TRUNCATE TABLE cache_field;
TRUNCATE TABLE cache_filter;
@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"