Skip to content

Instantly share code, notes, and snippets.

View webfacer's full-sized avatar
🤪
just coding it!

Ilic Davor webfacer

🤪
just coding it!
View GitHub Profile
@webfacer
webfacer / git-stash-recover.git
Last active December 13, 2017 16:19
Recover stash after pop or drop, when still in terminal you can see the stash hash which can be recovered with it. see also https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git
git stash apply (stash-hash) //
@Razoxane
Razoxane / reloadCSS.js
Created July 28, 2017 23:48 — forked from kdzwinel/reloadCSS.js
Reload CSS files without reloading the page
function reloadCSS() {
const links = document.getElementsByTagName('link');
Array.from(links)
.filter(link => link.rel.toLowerCase() === 'stylesheet' && link.href)
.forEach(link => {
const url = new URL(link.href, location.href);
url.searchParams.set('forceReload', Date.now());
link.href = url.href;
});
@jdeathe
jdeathe / using-xdebug-to-profile-a-php56u-vagrant-host.md
Last active September 20, 2018 15:07
Using Xdebug to Profile PHP on a Vagrant VM.

Using Xdebug to Profile a Vagrant VM.

These instructions are for profiling a PHP application running on a CentOS-6 remote host using the php56u php 5.6 packages from an OSX local host.

On remote

Install Xdebug for php56u.

# yum -y install \
@miya0001
miya0001 / cors-for-the-wordpress-rest-api.php
Last active January 31, 2023 07:42
CORS for the WordPress REST API
<?php
function my_customize_rest_cors() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: GET' );
header( 'Access-Control-Allow-Credentials: true' );
header( 'Access-Control-Expose-Headers: Link', false );
@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@fedir
fedir / SolrTYPO3.md
Created May 24, 2016 17:28
TYPO3 Solr extension configuraiton sample

Constants

plugin.tx_solr {
	solr {
	scheme = http

	host = YY.YY.YY.YY
	port = 8080

path = /solr/core_XXXX/

@githubrsys
githubrsys / readme.md
Last active July 20, 2022 09:59
TYPO3 fluid VHS: Group elements with wrap without Modulo

Summary

Imagine you have a list of elements. E.g. some DIV's (or something else) and you want to surround or wrap blocks or chunks of 3 with an <li> element.

Expected output Code

<li>
foo
@Joel-James
Joel-James / verify-uuid.php
Last active March 6, 2024 22:26
Check if UUID is in valid format
<?php
/**
* Check if a given string is a valid UUID
*
* @param string $uuid The string to check
* @return boolean
*/
function isValidUuid( $uuid ) {
if (!is_string($uuid) || (preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', $uuid) !== 1)) {
@smichaelsen
smichaelsen / Favicons.html
Last active October 12, 2023 17:52
Multiple Favicons in TypoScript
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers">
<link rel="apple-touch-icon" sizes="57x57" href="{f:uri.resource(path:'Favicons/apple-touch-icon-57x57.png')}">
<link rel="apple-touch-icon" sizes="60x60" href="{f:uri.resource(path:'Favicons/apple-touch-icon-60x60.png')}">
<link rel="apple-touch-icon" sizes="72x72" href="{f:uri.resource(path:'Favicons/apple-touch-icon-72x72.png')}">
<link rel="apple-touch-icon" sizes="76x76" href="{f:uri.resource(path:'Favicons/apple-touch-icon-76x76.png')}">
<link rel="apple-touch-icon" sizes="114x114" href="{f:uri.resource(path:'Favicons/apple-touch-icon-114x114.png')}">
<link rel="apple-touch-icon" sizes="120x120" href="{f:uri.resource(path:'Favicons/apple-touch-icon-120x120.png')}">
<link rel="apple-touch-icon" sizes="144x144" href="{f:uri.resource(path:'Favicons/apple-touch-icon-144x144.png')}">
<link rel="apple-touch-icon" sizes="152x152" href="{f:uri.resource(path:'Favicons/apple-touch-icon-152x152.png')}">
@dmitryd
dmitryd / Classes_Controller_MyController.php
Last active August 30, 2017 15:15
TYPO3 Extbase and "Insert records"
<?php
namespace DmitryDulepov\Myext\Controller;
class MyController {
/**
* @var \DmitryDulepov\Myext\\Domain\Repository\RecordRepository
* @inject
*/
protected $recordRepository;