Skip to content

Instantly share code, notes, and snippets.

View j3ll3yfi5h's full-sized avatar
🐟

Andrew Jelley j3ll3yfi5h

🐟
View GitHub Profile
@jacksleight
jacksleight / README.md
Last active November 20, 2021 20:01
Statamic Replace Asset Action

Statamic Replace Asset Action

Replace an asset with a new file. Also renames the asset to the new name (Statamic will update references).

Known Issues

  1. The asset Browse button doesn't seem to work inside an action modal (statamic/cms#4785). Not a huge issue as you'll probably be uploading a new file anyway, but if it did work you could replace one asset with another, which might be useful.
  2. If you upload a new file and then click Cancel instead of Run the new file will remain at the root of the container.
  3. If you select multiple assets only the first will be replaced.
@apisandipas
apisandipas / share-urls.md
Last active September 24, 2024 22:18 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@neverything
neverything / comopser-wp-cli.md
Last active December 7, 2021 07:42
Install composer and wp-cli on cyon.ch hostings with SSH access.

Cyon.ch/Hostpoint - Install composer & wp-cli

SSH into your server and stay in the home directory of the user. Check if you have a bin directory in your user directory already, in case you do, omit the mkdir bin.

Use bin folder in $HOME for user scriptsr

For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc. For the new config to be used run source ~/.bashrc or close and reopen your SSH session.

Composer

@robneu
robneu / wordpress-typekit-enqueue.php
Last active January 17, 2023 23:04 — forked from FernE97/typekit-enqueue.php
Enqueue typekit fonts to WordPress using wp_enqueue_scripts.
<?php
/**
* Enqueue typekit fonts into WordPress using wp_enqueue_scripts.
*
* @author Robert Neu
* @author Eric Fernandez
* @copyright Copyright (c) 2014, Robert Neu
* @license GPL-2.0+
* @link http://typekit.com
*/
@magnetikonline
magnetikonline / README.md
Last active September 30, 2020 13:00
Minimum Open Graph tags required for a webpage - for use with Facebook.

Open Graph tags for page <head>.

<meta property="og:title" content="title" />
<meta property="og:description" content="desc" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://url.com/" />
<meta property="og:image" content="http://url.com/image.jpg" />
@allybee
allybee / target_blank.js
Last active November 7, 2023 22:40
Add target="_blank" to external links with pure JavaScript.
function targetBlank() {
// remove subdomain of current site's url and setup regex
var internal = location.host.replace("www.", "");
internal = new RegExp(internal, "i");
var a = document.getElementsByTagName('a'); // then, grab every link on the page
for (var i = 0; i < a.length; i++) {
var href = a[i].host; // set the host of each link
if( !internal.test(href) ) { // make sure the href doesn't contain current site's host
a[i].setAttribute('target', '_blank'); // if it doesn't, set attributes