Skip to content

Instantly share code, notes, and snippets.

View akmur's full-sized avatar

Alessandro Muraro akmur

View GitHub Profile
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Options',
'menu_title' => 'Options',
'menu_slug' => 'options',
'capability' => 'edit_posts',
'redirect' => false
));
@akmur
akmur / cookie-policy-checker.js
Last active August 29, 2015 14:22
Cookie Policy Checker
@akmur
akmur / package.json
Created March 5, 2016 22:46 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@akmur
akmur / stickyheader.js
Last active April 9, 2016 11:21
Sticky Header script
var App = (function () {
// Sticky Header
var stickyHeader = function (navElement) { // needs the ID of the element
this.nav = document.getElementById(navElement);
this.siteBody = document.getElementsByTagName("body")[0];
this.stuck = false;
this.stickPoint = this.getDistance();
};
@akmur
akmur / swipe.js
Created March 2, 2017 13:52 — forked from wiesys/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.changedTouches[0].pageX;
touchstartY = event.changedTouches[0].pageY;
@akmur
akmur / geolocation.js
Created March 14, 2017 16:50
Geolocation Module
/* global document google */
/**
* This file contains code for the maps found in the website.
* It takes care of converting an address to a location by using google's geocode code.
*
* @summary Map Loader
*/
const mapLoader = (function(){
@akmur
akmur / Tablet Resolutions Regex
Created August 8, 2017 13:16
Tablet Resolutions Regex
^([7-9][0-9][0-9]|[0-1][0-0][0-5][0-9])x([1-8][0-9][0-9]|[1-9][0-9][0-9][0-9])$
the first three groups of numbers are for 768 numbers, assuming you are not interested in mobiles for example
@akmur
akmur / .eslintrc
Created August 21, 2017 10:52 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
var first = 'https://google.com';
var second = 'https://bing.com';
var third = 'https://duckduckgo.com';
var fourth = 'https://yandex.com';
var fifth = 'https://qwant.com';
module.exports = { first, second, third, fourth, fifth };