Skip to content

Instantly share code, notes, and snippets.

View tomhermans's full-sized avatar
👻
tinkering

Tom Hermans tomhermans

👻
tinkering
View GitHub Profile
<?php
/**
* Add dummy query var which causes all languages to be shown
* in the queries.
* See https://github.com/polylang/polylang/blob/2ed446f92955cc2c952b944280fce3c18319bd85/include/query.php#L125-L134
*/
add_filter( 'pll_filter_query_excluded_query_vars', function( $excludes ) {
$excludes[] = 'allLanguages';
return $excludes;
@dyyybek
dyyybek / easing.py
Created March 25, 2018 12:50 — forked from th0ma5w/easing.py
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
@xsaamiir
xsaamiir / restaurant-menu.json
Last active January 29, 2023 13:51
example of a restaurant's menu in json from https://codebeautify.org/jsonviewer/cb51497a
{
"array":{
"type":"Restaurant Menu",
"restaurant-info":{
"id":"121721",
"sponsored":"0",
"user-favourite":"",
"name":"Nandos Banani",
"address":"Road-11, Banani, Dhaka",
"rating":"0.00",
@dvlop
dvlop / gist:fca36213ad6237891609e1e038a3bbc1
Last active May 29, 2024 12:37 — forked from allthingsdem/gist:63b3223a7d14ac1f2457
My long list of bad bots to block in htaccess, ready to copy and paste!
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot
@sarahdayan
sarahdayan / modifiers.scss
Last active October 31, 2023 18:28
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@bradenbest
bradenbest / input.js
Last active February 28, 2024 09:08
Input Helper Class
function Input(el){
var parent = el,
map = {},
intervals = {};
function ev_kdown(ev)
{
map[ev.key] = true;
ev.preventDefault();
return;
@cblunt
cblunt / gulpfile.js
Created May 11, 2017 21:37
Gulpfile for simple static website prototyping
// $ npm install
// $ gulp serve
// $ open http://localhost:8080
var gulp = require('gulp'),
del = require('del'),
scss = require('gulp-sass'),
htmlmin = require('gulp-htmlmin'),
cleancss = require('gulp-clean-css'),
connect = require('gulp-connect'),
@devlim
devlim / 000-default.conf
Last active September 13, 2023 15:03
Apache default virtual host file, default ssl conf file. /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/default-ssl.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
@zeshanshani
zeshanshani / acf_options_multilingual.php
Last active October 10, 2023 11:25
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/
@chrismccoy
chrismccoy / restapi.txt
Last active March 30, 2024 08:17
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js