float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move Yoast to bottom | |
function yoasttobottom() { | |
return 'low'; | |
} | |
add_filter( 'wpseo_metabox_prio', 'yoasttobottom'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Display posts only from today and in the future: | |
* http://old.support.advancedcustomfields.com/discussion/6000/how-to-sort-posts-by-acf-date-and-display-only-future-posts | |
* by Pasnon | |
*/ | |
$date_args = array( | |
'post_type' => 'events', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getTranslate(item: HTMLElement): number | number[] | undefined { | |
const transArr = []; | |
if (!window.getComputedStyle) { | |
return; | |
} | |
const style = window.getComputedStyle(item); | |
const transform = style.transform || style.webkitTransform; | |
let mat = transform.match(/^matrix3d\((.+)\)$/); | |
if (mat) { | |
return parseFloat(mat[1].split(', ')[13]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: custom woocommerce feed | |
* Description: Custom feed for importing woocommerce products in other stores | |
* Author: Arden de Raaij | |
* | |
* @package WordPress | |
* | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function offset(elt) { | |
var rect = elt.getBoundingClientRect(), bodyElt = document.body; | |
return { | |
top: rect.top + bodyElt .scrollTop, | |
left: rect.left + bodyElt .scrollLeft | |
} | |
} | |
//use: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const path = require('path'); | |
module.exports = { | |
entry: './src/main.js', | |
output: { | |
path: path.resolve(__dirname, './build'), | |
filename: 'bundle.js', | |
}, | |
module: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const avengers = ['Thor', 'The Hulk', 'Captain America']; | |
let guardians = ['Star Lord', 'Gamorra', 'Drax', 'Rocket', 'Groot']; | |
// Spread out arrays in a new array and put a new value in between them | |
const heroes = [...avengers, 'Loki', ...guardians]; | |
// Adding new stuff to an array just got easier too | |
guardians = [...guardians, 'Mantis', 'Yondu', 'Nebula']; | |
// Or simply making a TRUE copy of an array | |
const avengersCopy = [...avengers]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Using the library ramda, what is the result of the following code? | |
* R.reduce((acc,x) => R.compose(R.flip(R.prepend)(acc), R.sum,R.map(R.add(1)))([x,...acc]), [0])([13, 28]); | |
* Explain each of the steps the best you can. | |
*/ | |
const R = require('ramda'); | |
// Reduce function iterating over [13, 28] | |
// starting point: [0] | |
const test = R.reduce( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
browser-sync start -s --directory "/" | |
browser-sync start -s --directory "/" --files "**/*.html" |
NewerOlder