Skip to content

Instantly share code, notes, and snippets.

View Jursdotme's full-sized avatar

Rasmus Jürs Jursdotme

View GitHub Profile
@Jursdotme
Jursdotme / gulpfile.js
Created August 28, 2017 13:59
Undescores (_s) build tooling
// Gulp.js configuration
'use strict';
const
// Gulp and plugins
gulp = require('gulp'),
gutil = require('gulp-util'),
newer = require('gulp-newer'),
imagemin = require('gulp-imagemin'),
@Jursdotme
Jursdotme / .htaccess
Created August 31, 2017 09:31
Use production media files on local development wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/?.*$
RewriteRule ^(.*)$ http://ntf.dk/$1 [QSA,L]
</IfModule>
/* ========== Smooth Scroll ========== */
(
function ( $ ) {
$.fn.vantageSmoothScroll = function () {
$( this ).click( function ( e ) {
var $a = $( this );
var $target = $( '[name=' + this.hash.slice( 1 ) + ']' ).length ? $( '[name=' + this.hash.slice( 1 ) + ']' ) : $( $a.get( 0 ).hash );
if ( $target.length ) {
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@Jursdotme
Jursdotme / style.css
Last active September 27, 2017 09:20
FD font rettelse
html body, h1, h2 ,h3 ,h4 ,h5 ,h6 {
font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", sans-serif !important;
}
jQuery(document).ready(function() {
jQuery(window).on('resize', function() {
jQuery('#negative-margin').css('margin-top', jQuery('#negative-margin').outerHeight() * -1 + 'px');
})
.trigger('resize');
});
@Jursdotme
Jursdotme / inzite-mu.php
Created October 16, 2017 09:53
Wordpress Must Use Plugin template
<?php
/*
Plugin Name: Inzite Must Use plugin
Plugin URI: http://jurs.me
Description: Extra functions.
Version: 1.0.0
Author: Rasmus Jürs
Author URI: http://jurs.me
License: GPL
*/
function renderProductList(boolHighlighted)
intAmount = 0 '0 equals all(*)
intRows = 75
strFields = "i.ID,i.ItemName,i.Image,i.ParentID, i.Highlighted, i.NetPrice, i.Colli, i.UnitOfMeasure, i.ItemName2"
strOrder = "Order By i.ItemName"
strSearch = ""
intPageNum = 1
intCategory = 0
intLastPage = 0 '0 Gets the last page as intLastPage
@Jursdotme
Jursdotme / shortcode.php
Created February 14, 2018 07:45
Mailpoet bulk subscribe
// Add Shortcode
function mailpoet_bulk_subscribe_func()
{
ob_start(); ?>
<form action="?submit=true" method="POST">
<input name="email" type="text" required placeholder="Email address">
<input name="first_name" type="text" placeholder="First name">
<input name="last_name" type="text" placeholder="Last name">
@Jursdotme
Jursdotme / GTM-K7B2CN6_v18.json
Last active March 8, 2018 07:09
Inzite Tag manager template
{
"exportFormatVersion": 2,
"exportTime": "2018-03-07 15:14:39",
"containerVersion": {
"path": "accounts/2288261640/containers/8196307/versions/18",
"accountId": "2288261640",
"containerId": "8196307",
"containerVersionId": "18",
"container": {
"path": "accounts/2288261640/containers/8196307",