Skip to content

Instantly share code, notes, and snippets.

View haleyngonadi's full-sized avatar

haley. haleyngonadi

  • Canada
View GitHub Profile
@HoundstoothSTL
HoundstoothSTL / anchor-scroll-with-offset.js
Created May 3, 2013 15:43
Anchor scroll with fixed header offset
(function($) {
$('a[href*=#]:not([href=#])').click(function()
{
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname)
{
var target = $(this.hash),
headerHeight = $(".primary-header").height() + 5; // Get fixed header height
@kares
kares / jquery.parseparams.js
Created May 5, 2011 11:28
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@JoeSz
JoeSz / change-url-while-scrolling.html
Created September 24, 2016 15:48
Detect element is in the viewport and then change browser url
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Scrolling URL Hash</title>
<meta name="description" content="Webpage for xxxx">
<style>
body {
height: 2000px;
}
@vukanac
vukanac / install-php72-osx.md
Created August 20, 2017 19:26
How to install php72 on Mac OS X with homebrew.

Skip this:

brew tap homebrew/dupes
brew tap homebrew/versions

As:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
@stephanieleary
stephanieleary / blockquote-cite-tinymce.js
Created October 16, 2016 20:01
Blockquote + Cite TinyMCE button JS
(function() {
tinymce.PluginManager.add('blockquote_cite', function( editor, url ) {
editor.addButton( 'blockquote_cite', {
title: 'Blockquote & Cite',
icon: "icon dashicons-testimonial",
onclick: function() {
editor.windowManager.open( {
title: 'Insert Blockquote and Citation',
body: [
{
@devinsays
devinsays / combine-menus.php
Created November 13, 2015 18:09
Combines two WordPress menus into one.
<?php
/**
* Combines the markup of two menu areas into one.
*/
// Get the markup list items in the first menu.
$menu = wp_nav_menu( array(
'theme_location'=> 'menu-1',
'fallback_cb' => false,
'container' => '',
@ouelletv
ouelletv / socialSharePopups.js
Created August 1, 2018 13:58 — forked from josephabrahams/socialSharePopups.js
Facebook & Twitter Share Popup Windows
export default function() {
document.querySelectorAll('.js-share-facebook-link').forEach(function(el){
el.addEventListener('click', function(e){
var href = e.target.href;
e.preventDefault();
window.open(href, "Facebook", "toolbar=no,location=0,status=no,menubar=no,scrollbars=yes,width=600,height=400,resizable=1");
})
});
@oguzhanaslan
oguzhanaslan / ResizingImageJquery.js
Last active February 23, 2020 08:08
Resizing image with jQuery
$(document).ready(function(){
$('.img-responsive').each(function() {
var maxWidth = 180; // Max width for the image
var maxHeight = 3000; // Max height for the image
var ratio = 0; // Used for aspect ratio
var width = $(this).width(); // Current image width
var height = $(this).height(); // Current image height
// Check if the current width is larger than the max
@harrypujols
harrypujols / WordPress Theme Customizer Sample.php
Created September 17, 2012 06:50 — forked from Abban/WordPress Theme Customizer Sample.php
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@Phonbopit
Phonbopit / AndroidManifest.xml
Last active March 6, 2019 07:55
Android GSON with Custom ListView Tutorial , Article Link: http://devahoy.com/2014/05/android-custom-listview-with-gson-tutorial/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devahoy.sample.ahoygson" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"