Skip to content

Instantly share code, notes, and snippets.

View mandrasch's full-sized avatar
🔍

Matthias Andrasch mandrasch

🔍
View GitHub Profile
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@jcnesci
jcnesci / how-to-delicious-to-evernote.md
Last active March 17, 2018 17:51
How to export Delicious bookmarks for Evernote (June 2016)

How to export Delicious bookmarks for Evernote (June 2016)

Delicious is going into disrepair, so I needed to find another home for my bookmarks. The transfer to Evernote was causing me headaches (since most things I found online no longer worked) so when I figured it out, I thought I'd document how I got it to work, for posterity.

Goal

Take Delicious bookmarks with tags, and create a new Bookmarks notebook in Evernote (basic/free version) which contains a new note for each old bookmark, with tags intact.

Steps

@smichaelsen
smichaelsen / packagestates.md
Last active October 12, 2020 11:32
Goodbye PackageStates.php

Getting PackageStates.php out of your TYPO3 project's git

Why?

Ideally your git repository only contains code that you and your team wrote yourself by hand.

  • 3rd party code should be included via a dependency manager (like composer)
  • Generated files (like compiled stylesheets) should be excluded and be regenerated whenever needed (for example when you deploy your code to a server).

PackageStates.php contains the information which TYPO3 extensions are available and loaded in the system and is typically generated when you use the extension manager to (un)install extensions.

@ffoodd
ffoodd / improved-sr-only.markdown
Last active March 21, 2025 09:26
Improved .sr-only

Improved .visually-hidden

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@miya0001
miya0001 / cors-for-the-wordpress-rest-api.php
Last active January 29, 2025 02:47
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 );
@max-mapper
max-mapper / bibtex.png
Last active November 6, 2024 09:03
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@mtwalsh
mtwalsh / deploy.php
Last active December 8, 2022 16:31
Deployer recipe for Craft CMS 3 projects.
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'enovate.co.uk');
// Project repository
set('repository', '[email protected]:enovatedesign/project.git');
@antstanley
antstanley / .eleventy.js
Last active September 12, 2022 21:43
Using PurgeCSS and CleanCSS with 11ty to remove unused CSS selectors
const Purgecss = require('purgecss')
const { JSDOM } = require('jsdom')
const CleanCSS = require("clean-css");
//array of css files to combine
const cssFiles = ['./src/css/custom.css','./src/css/markdown.css', './src/css/tachyons.css']
// cleanCSSOptions for minification and inlining css, will fix duplicate media queries
const cleanCSSOptions = {
level: {
@CapWebSolutions
CapWebSolutions / sec-scan-root.sh
Last active April 23, 2024 15:47
Latest iteration of security scanning script for MainWP instance.
#
# This script is executed from a terminal prompt at the root of your MainWP WordPress website.
# It uses the same services as WP CLI, so if WP CLI runs, this should also.
#
# Execute MainWP CLI command to generate a list of all configured sites in MainWP
# Pipe output through filter to remove columns 3 and 4 of output. These columns hold the 2 digit site number. Adjust if more than 99 sites.
# Pipe that output to get rid of the comment lines in the site listing.
# Pipe that output through the SED editor inserting the security scan command at the beginning of the line
# Send everything to a shell script to be executed.
cd /var/www/capwebwpcare.com/htdocs