Skip to content

Instantly share code, notes, and snippets.

View hofmannsven's full-sized avatar
🌴
Coding

Sven hofmannsven

🌴
Coding
View GitHub Profile
@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@henriquemoody
henriquemoody / phpunit.bash
Last active May 10, 2023 02:52
PHPUnit Bash Completion. sudo curl -L https://gist.githubusercontent.com/henriquemoody/5014805/raw/phpunit.bash -o /etc/bash_completion.d/phpunit && source /etc/bash_completion.d/phpunit
# Bash-Completion script for PHPUnit
#
# Created by Henrique Moody <henriquemoody@gmail.com>
#
_phpunit()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
@vishaltelangre
vishaltelangre / blur.css
Created April 17, 2014 09:34
cross browser blur filter using css
.blur {
-webkit-filter: blur(3px);
-moz-filter: blur(3px);
-ms-filter: blur(3px);
-o-filter: blur(3px);
/* FF doesn't support blur filter, but SVG */
filter: url("data:image/svg+xml;utf8,<svg height='0' xmlns='http://www.w3.org/2000/svg'><filter id='svgBlur' x='-5%' y='-5%' width='110%' height='110%'><feGaussianBlur in='SourceGraphic' stdDeviation='5'/></filter></svg>#svgBlur");
filter: progid: DXImageTransform.Microsoft.Blur(PixelRadius = '3');
filter: blur(3px);
}
@benlk
benlk / 0-toc.md
Last active March 29, 2023 13:13
Collection of notes on WP_UnitTestCase
  1. Table of contents
  2. General information
    1. Terms
    2. General structure of a test
    3. WordPress-specific assertions and test functions
      • enqueues
      • creating posts
      • creating terms
      • attaching images
  • ?
@hofmannsven
hofmannsven / README.md
Last active December 20, 2023 09:46
Notes on working with JetBrains PhpStorm IDE on macOS.
@hofmannsven
hofmannsven / README.md
Last active January 25, 2023 10:47
Notes on Favicons, Tile Icon and Tab Icons

Favicons and more

Favicon

Install imagemagick: brew install imagemagick

Creating the .ico file with multiple sizes:

@achmadfatoni
achmadfatoni / guzzle_raw_post_request.php
Created August 29, 2017 09:21
Guzzle Raw POST request
$client = new Client();
$array = [];
$res = $client->request('POST', $url, [
'body' => json_encode($array),
'headers' => [
'Content-Type' => 'application/json',
]
]);
@jeffochoa
jeffochoa / Response.php
Last active April 30, 2024 10:45
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@vegaskev
vegaskev / functions.php
Created July 20, 2018 22:05
Change Gravity Forms Spinner to CSS Spinner
// Changes Gravity Forms Ajax Spinner (next, back, submit) to a transparent image
// this allows you to target the css and create a pure css spinner like the one used below in the style.css file of this gist.
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder
}