Skip to content

Instantly share code, notes, and snippets.

@joetm
joetm / watermark-htaccess.php
Last active June 12, 2020 16:22
Watermark images on-the-fly with htaccess
/*
# add this to .htaccess
# AddHandler watermarked .thumb
# AddHandler watermarked .attach
AddHandler watermarked .jpg
Action watermarked /home/pornster/cpattachments/wrapper.php
*/
<?php
$watermark = "watermark.png";
@joetm
joetm / functions.php
Last active June 11, 2019 05:55
Solutions for frequent WordPress problems
<?php
/*
* Solutions for frequent wordpress problems
*/
// remove the emoji code
function disable_wp_emojicons() {
@joetm
joetm / mouseleave-popup
Created October 17, 2015 10:37
Annoying popup when mouse leaves the browser window
<!DOCTYPE html>
<html>
<head>
<title>Mouseout Popup Demonstration</title>
<link href="bootstrap4/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<body style="text-align:center;">
Move the mouse outside of the browser window.
<?php
/* Parse the google bookmarks for starred locations */
// requires allow_url_fopen = true
// Download your bookmarks from this url: https://www.google.com/bookmarks/bookmarks.html?hl=en
// You need to be logged into your Google Account for this to work.
// Save the bookmarks in the file GoogleBookmarks.html
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
watch = require('gulp-watch'),
sass = require('gulp-sass'),
//less = require('gulp-less'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
gutil = require('gulp-util'),
jslint = require('gulp-jslint-simple'),
// Karma configuration
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
//browserNoActivityTimeout: 100000,
//captureTimeout: 90000,
/*global module, require*/
module.exports = function (grunt) {
'use strict';
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/ashe",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/ess",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/soc",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],