Skip to content

Instantly share code, notes, and snippets.

View petemolinero's full-sized avatar

Pete Molinero petemolinero

View GitHub Profile
@bryceadams
bryceadams / EDD Add to Cart + Checkout
Created September 7, 2012 03:07
Easy Digital Downloads - Add to Cart and redirect to Checkout Page
<a href="<?php echo edd_get_checkout_uri(); ?>?edd_action=add_to_cart&download_id=<?php echo get_the_ID(); ?>">Add to Cart</a>
@wenjul
wenjul / index.html
Created November 22, 2012 15:22 — forked from anonymous/index.html
Advanced Checkbox Hack - This works for both iOS and Android! You can use almost the default checkbox-hack syntax and just need to add two things:## 1. Android smaller than / equal 4.1.2pseudo-class + general/adjacent siblin
<h1>Advanced Checkbox Hack</h1>
<input type="checkbox" id="button" />
<label for="button" onclick>click / touch</label>
<div>
Change my color!
<br>
<span>even mine :D</span>
</div>
@afischoff
afischoff / pardot-form-handler-iframe.html
Last active December 1, 2022 20:51
Example of using a hidden iframe to pass data to a Pardot form handler before continuing with normal form submission.
<html>
<head>
<title>Pardot Example Form Handler Submit</title>
<!-- Include jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!-- Post to Pardot function -->
<script type="text/javascript">
// set the pardot form handler url and form element id
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active April 11, 2024 12:33
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@chriswales95
chriswales95 / docker-compose.yml
Last active November 28, 2022 16:39
Mutagen compose example
version: "3.7"
services:
drupal:
depends_on:
- db
build: ./app
restart: unless-stopped
volumes:
- code:/app # mount the mutagen volume
environment:
@idleberg
idleberg / vscode-macos-context-menu.md
Last active July 13, 2024 18:11
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
declare module "vue-instantsearch" {
import Vue from "vue";
import { InstantSearch, InstantSearchOptions } from "instantsearch.js/es/types/instantsearch";
import { SearchClient } from "instantsearch.js/es/types/algoliasearch";
export interface SearchItem {
value: string;
count: number;
label: string;
isRefined: boolean;
version: '3.5'
volumes:
code:
services:
web:
build: .
volumes:
- code:/var/www