Skip to content

Instantly share code, notes, and snippets.

View webgurus's full-sized avatar
🏠
Working from home

Gergely Márton webgurus

🏠
Working from home
View GitHub Profile
@webgurus
webgurus / gulpfile.js
Created October 5, 2023 16:33 — forked from bhdd/gulpfile.js
Updated Sage 8.6.0 build files
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
// Init Segment
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
analytics.load("YOUR_WRITE_KEY");
ana
@webgurus
webgurus / photoswipe.js
Created November 25, 2020 17:49 — forked from panoply/photoswipe.js
Photoswipe.js ES6 Implementation
import PhotoSwipe from 'photoswipe';
import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default';
export default (selector) => {
const parseThumbnailElements = (element) => {
let items = [];
const thumbs = element.parentNode.querySelectorAll('figure');
@webgurus
webgurus / gist:2d2497b7c164039783f3
Last active August 29, 2015 14:25 — forked from kalenjohnson/gist:0e5805894a75bcec0204
Codeship Deploy to WPEngine
REMOTE_REPOSITORY=${REMOTE_REPOSITORY:?'You need to configure the REMOTE_REPOSITORY environment variable!'}
REMOTE_BRANCH=${REMOTE_BRANCH:?'You need to configure the REMOTE_BRANCH environment variable!'}
set -e
git fetch --unshallow || true
git push ${REMOTE_REPOSITORY} ${CI_COMMIT_ID}:${REMOTE_BRANCH}
cd wp-content/themes/<theme>
npm install -g bower gulp
npm install
bower install
gulp --production
<?php
/**
* Hides the 'view' button in the post edit page
*
*/
function hv_hide_view_button() {
$current_screen = get_current_screen();
<?php
/* place in theme's functions.php file */
/* disable json api if api key not correct */
add_action('init','json_api_apikey_check' , 1 );
function json_api_apikey_check()
{
$api_key = 'hello';
$base = get_option('json_api_base', 'api');
$this_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
/*
Allows for ajax requests to be run synchronously in a queue
Usage::
var queue = new $.AjaxQueue();
queue.add({
url: 'url',