Skip to content

Instantly share code, notes, and snippets.

View mauryaratan's full-sized avatar
🦌

Ram Ratan Maurya mauryaratan

🦌
View GitHub Profile
@josue
josue / MAMP-DOCK-INVISIBLE.sh
Created March 27, 2012 03:53
Hide or show the MAMP Pro dock icon.
#!/bin/bash
# Place this script in dir: /usr/bin
# Change permissions: sudo chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
#
# Ensure the MAMP 'Info.plist' file has the following entry:
# <key>LSUIElement</key>
# <string dock-visible="1">NO</string>
#
# Usage:
@gmazzap
gmazzap / VersionNumber.php
Created March 24, 2019 19:37
Version number parser and comparator compatible with both Semver and WordPress version numbers.
<?php
/**
* Copyright 2019 Inpsyde GmbH
*
* @license MIT https://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@bearded-avenger
bearded-avenger / gist:e9d7ec26b0675bbc208a
Created September 16, 2014 16:24
Full Screen Components in Make
/*
- .aesop-on-THEMENAME is a class that aesop applies to themes
- this breaks the width that sets on main column
- .single targeting only single posts
*/
.aesop-on-make.single .container {
max-width:100%;
padding-left:0;
padding-right:0;
}
@heyjones
heyjones / heyjones-userpass.php
Created December 14, 2020 01:24
Enables application password generation through the REST API. Use at your own risk!
<?php
namespace heyjones\userpass;
add_action( 'rest_api_init', __NAMESPACE__ . '\\rest_api_init' );
function rest_api_init() {
register_rest_route(
'heyjones',
@carlalexander
carlalexander / expect-header-fix.php
Last active August 13, 2021 00:40
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = '';
@polevaultweb
polevaultweb / ssl.sh
Created January 31, 2018 07:16
Easily create local SSL certificates for development sites that work with you own Certificate Authority https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/
#!/bin/sh
if [ "$#" -ne 1 ]
then
echo "Usage: Must supply a domain"
exit 1
fi
DOMAIN=$1
@caged
caged / svg-to-png.js
Created January 27, 2013 18:11
Convert SVG's to PNGs. This works OK if the SVG's styles are inline. The SVG element must contain an xmlns attribute. Webkit also requires you specify a font size on `text` elements.
var svg = document.getElementById('graph'),
xml = new XMLSerializer().serializeToString(svg),
data = "data:image/svg+xml;base64," + btoa(xml),
img = new Image()
img.setAttribute('src', data)
document.body.appendChild(img)
@PaulKinlan
PaulKinlan / waitForElement.js
Last active July 19, 2022 22:32
waitForElement.js
function waitForElement(selector) {
return new Promise(function(resolve, reject) {
var element = document.querySelector(selector);
if(element) {
resolve(element);
return;
}
var observer = new MutationObserver(function(mutations) {
@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;