Skip to content

Instantly share code, notes, and snippets.

View hsquareweb's full-sized avatar

Hassan Elhassan hsquareweb

View GitHub Profile
@james2doyle
james2doyle / wpcf7-events.js
Last active May 4, 2017 17:40
Setup Google Tag manager for Contact Form 7. Focus fields when an error occurs.
jQuery(document).ready(function($) {
$(".wpcf7").on('wpcf7:mailsent', function() {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'formSubmitSuccess',
'formId': 'contactForm'
});
}).on('wpcf7:invalid', function() {
// focus errors on contact form
window.location.hash = $('.wpcf7-not-valid').get(0).id;
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@torgeir
torgeir / gulpfile.js
Last active June 12, 2023 09:52 — forked from markgoodyear/01-gulpfile.js
Example gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@Dimasmagadan
Dimasmagadan / WP_Query.php
Last active November 21, 2022 06:27 — forked from luetkemj/wp-query-ref.php
#WordPress query with args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/