Skip to content

Instantly share code, notes, and snippets.

View cannap's full-sized avatar
💥
Working from home

Marko Bolliger cannap

💥
Working from home
View GitHub Profile
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
//require('VariantSettings.php');
/*
* Todo: php max_input_vars and woocommerce
* Todo: define( 'WC_MAX_LINKED_VARIATIONS', 100 );
*/
/* global $ emi */
(function () {
let wishListAjax = false
$('.add-to-wishlist').on('click', function (e) {
e.preventDefault()
const productID = $(this).data('product-id')
const removeItem = $(this).hasClass('added') ? 1 : 0
$(this).toggleClass('added')
if (wishListAjax) {
wishListAjax.abort()
@cannap
cannap / eslintrc.js
Created August 19, 2017 00:04
eslint standard vscode fix
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true
@cannap
cannap / wp-comment-walker.php
Created September 7, 2017 11:23 — forked from georgiecel/wp-comment-walker
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
const { ServiceProvider } = require('@adonisjs/fold')
class BoomProvider extends ServiceProvider {
register () {
this.app.bind('Adonis/Middleware/Boom', app => {
const BoomMiddleware = require('./middleware')
return new BoomMiddleware()
})
}
}
const Config = use('Config')
const { Command } = require('@adonisjs/ace')
const { Nuxt, Builder } = require('nuxt')
class NuxtBuild extends Command {
static get signature () {
return 'nuxt:build'
}
static get description () {
const { ServiceProvider } = require('@adonisjs/fold')
const boom = require('boom')
const STATUS_CODES = {
'100': 'Continue',
'101': 'Switching Protocols',
'102': 'Processing',
'200': 'OK',
'201': 'Created',
'202': 'Accepted',
@cannap
cannap / Test.js
Created September 17, 2017 18:18
var UserService = make('App/Services/UserService')
class AuthController {
async login ({ request, response, auth }) {
UserService.demo()
const { email, password } = request.all()
try {
const token = await auth.attempt(email, password)
response.send(token)
} catch (error) {
@cannap
cannap / test.js
Created September 23, 2017 23:29
if (!content.hasOwnProperty('checksum_type')) {
return {
forPaypal () {
console.log(content)
},
forSofort () {}
}
}
function iconic_output_engraving_field() {
global $product;
if ( ! check_user_role( 'gewerbe' ) )
return;
?>
<hr>
<div class="iconic-engraving-field">
<p class="form-row legal terms wc-terms-and-conditions">
<input type="checkbox" class="input-checkbox" name="duplicating" id="duplicating">