Skip to content

Instantly share code, notes, and snippets.

@creold
creold / textBlock.jsx
Created August 17, 2023 08:25
Converts selected point textFrames into a Block of Text. Adobe Illustrator script
//@target Illustrator
// script.name = textBlockLive.jsx;
// script.description = converts selected point textFrames into a Block of Text;
// script.required = one document with at least two selected Point Text frames;
// script.parent = carlos canto // 12/4/11; Update 03/15/205 added User Defined Units, cosmetics
// script.modification = sergey osokin // 08/12/23; keep text editable, sort texts by Y, cosmetics
// script.elegant = false;
function main() {
@istepanov
istepanov / Configuration.h
Last active October 24, 2024 09:18
Marlin Anet A8 config
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@celsowhite
celsowhite / wp-clean-admin.php
Created August 2, 2017 14:37
Functions to clean admin dashboard menu and welcome screen.
<?php
/*---------------------
Dashboard Menu Adjustments
---------------------*/
// Only hide specific dashboard menu items on the live server.
// Show on localhost so we can control every component.
$whitelist = array('127.0.0.1','::1');
@worawit
worawit / eternalblue8_exploit.py
Last active March 16, 2024 18:38
Eternalblue exploit for Windows 8/2012
#!/usr/bin/python
# This file has no update anymore. Please see https://github.com/worawit/MS17-010
from impacket import smb, ntlm
from struct import pack
import sys
import socket
'''
EternalBlue exploit for Windows 8 and 2012 by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
function wpex_honor_ssl_for_attachments( $url ) {
if ( is_ssl() ) {
$upload_info = wp_upload_dir();
if ( isset( $upload_info[ 'baseurl' ] ) && strpos( $upload_info[ 'baseurl' ], 'https' ) ) {
$http = site_url( FALSE, 'http' );
$https = site_url( FALSE, 'https' );
return str_replace( $http, $https, $url );
}
}
<?php
function odin_contact_author_form($author_id) {
$author_email = get_the_author_meta( 'user_email', $author_id );
$form = new Odin_Contact_Form(
'form_id', // ID do formulário
'[email protected]', // E-mail do destinatário.
array( '[email protected]', '[email protected]', $author_email ), // array com e-mails que receberão cópia.
array( '[email protected]' ) // array com e-mails que receberão cópia oculta.
// array( 'class' => 'form' ) // array com atributos para o formulário.
// 'file' // string com método que será enviado o anexo, no caso 'file' como anexo e 'url' para enviar links.
@woogist
woogist / functions.php
Created June 16, 2015 07:47
Autocomplete all WooCommerce orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@ChromeOrange
ChromeOrange / functions.php
Last active May 7, 2020 22:50
Set a minimum order value for WooCommerce - requires 2.1 or higher
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 50;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
@timothyandrew
timothyandrew / README.md
Last active December 16, 2023 17:05
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
<?php
//FROM
//http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/
//http://webstractions.com/wordpress/remove-recent-comments-inline-styl/
//http://wpengineer.com/1438/wordpress-header/
//https://github.com/boldperspective/Whiteboard-Framework
//REMOVE ADMIN BAR
add_filter( 'show_admin_bar', '__return_false' );