Skip to content

Instantly share code, notes, and snippets.

View tdlm's full-sized avatar

Scott Weaver tdlm

View GitHub Profile
@markhker
markhker / zillowImageDownloader.js
Created October 20, 2021 00:50
Zillow Download images
/**
* STEP 1: Click on the first image to open the image lightbox carousel
*/
/**
* STEP 2: Open Dev Tools Console.
* Copy and paste code below, replace the query variables if they changed
* This will download the images in webp and jpg
@cyberwani
cyberwani / wordpress-upload-base64.php
Created September 13, 2019 10:19
Upload a base64 string as image to the WordPress media library
<?php
/**
* Save the image on the server.
*/
function save_image( $base64_img, $title ) {
// Upload dir.
$upload_dir = wp_upload_dir();
$upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR;
// ==UserScript==
// @name Convert post to Gutenberg
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Convert Wordpress classic posts to Gutenberg layout
// @author Micah Engle-Eshleman
// @include /^https:\/\/subdomain\.domain\.com\/wp-admin\/post.php\?post=\d+&action=edit/
// @grant none
// ==/UserScript==
@sorenlouv
sorenlouv / useComponentId.js
Last active June 16, 2023 15:26
React hook for getting a unique identifier for a component
import { useRef } from 'react';
let uniqueId = 0;
const getUniqueId = () => uniqueId++;
export function useComponentId() {
const idRef = useRef(getUniqueId());
return idRef.current;
}
@wpscholar
wpscholar / .eslintignore
Last active March 14, 2022 10:21
Webpack 4 Config for WordPress plugin, theme, and block development
**/*.min.js
**/*.build.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@igorbenic
igorbenic / block-atts.js
Last active June 16, 2022 00:44
How to create a Gutenberg Block for Displaying a Post | https://www.ibenic.com/create-gutenberg-block-displaying-post/
registerBlockType( 'cgb/block-guten-load-post', {
// ...
keywords: [
__( 'my-block — CGB Block' ),
__( 'CGB Example' ),
__( 'create-guten-block' ),
],
attributes: {
content: {
@igorbenic
igorbenic / block.js
Last active April 22, 2022 22:25
Gutenberg Select Post - Duplicate Controls
/**
* BLOCK: my-block
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
// Import CSS.
import './style.scss';
import './editor.scss';
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@allysonsouza
allysonsouza / .htaccess
Created May 24, 2016 13:27
Enabling PHP 7 on Hostgator trough htaccess
# Habilitar o PHP 7.0
AddHandler application/x-httpd-php70 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php70/lib
</IfModule>

Git Cheat Sheet

Commands

Getting Started

git init

or