Skip to content

Instantly share code, notes, and snippets.

@victormattosvm
victormattosvm / fix.php
Last active May 27, 2022 13:13
Fix for "anr_error" when using WPGraphQL or WP REST API with Captcha4WP (old Advanced Nocaptcha & Invisible Captcha)
<?php
/**
* This code disables the Captcha verification when using WPGraphQL or WP REST API
* It fixes the "anr_error" issue.
*
* Put this code in your functions.php
*/
add_action(
'rest_api_init',
@Yiannis128
Yiannis128 / youtube-rss-subscriptions
Last active April 10, 2025 23:20
This is a python script that extracts your YouTube subscriptions into an RSS feed. Simply provide as an argument to the script, the path where you have the html file saved of the https://www.youtube.com/feed/channels make sure to check the whole page is saved because the script can only see the channels that are in that file.
#!/usr/bin/env python3
# Licence: GPLV3
import requests
from bs4 import BeautifulSoup as soup
from sys import argv as argv
from time import sleep
def get_channel_id(url):
@timba64
timba64 / function.php
Last active October 25, 2021 14:13 — forked from nandomoreirame/function.php
WordPress REST API send email SMTP in with PHPMailer
<?php
function sendWithPhpMailer($subject, $body, $reply) {
require(ABSPATH . WPINC . '/class-phpmailer.php');
require(ABSPATH . WPINC . '/class-smtp.php');
// date_default_timezone_set( 'America/Sao_Paulo' );
$blogname = wp_strip_all_tags( trim( get_option( 'blogname' ) ) );
$smtpHost = wp_strip_all_tags( trim( get_option( 'smtp_host' ) ) );
@ilayshp
ilayshp / node_test.py
Created March 21, 2019 07:07
[python] node creation, add connection in xpresso, c4d
import c4d
def main():
global vecoutp
obj = doc.GetActiveObject()
tag = doc.GetActiveTag()
if not tag:
tag = c4d.BaseTag(c4d.Texpresso)
obj.InsertTag(tag)
@gr4ph0s
gr4ph0s / [C4D]PoseMasterUi_Exemple.py
Created May 23, 2017 11:41
Exemple of GeUserArea who imitate browser
# coding: utf-8
"""
A GeUserArea Exemple for display multiple content.
Hardly based on https://github.com/NiklasRosenstein/c4d-2048 from Niklas
"""
__author__ = 'Adam Maxime - Graphos <gr4ph0s(at)hotmail.fr>'
__version__ = '1.0'
import c4d
@martinapugliese
martinapugliese / boto_dynamodb_methods.py
Last active June 30, 2024 10:00
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
@NiklasRosenstein
NiklasRosenstein / c4d_IntegrateSplineData.py
Last active November 14, 2017 19:06
Adaptive method for approximating the integral of a c4d.SplineData (i.e. the area "under" the spline).
# Copyright (c) 2016 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@donovankeith
donovankeith / ObjectBrowser.pyp
Created June 17, 2016 18:55
A Cinema 4D Python TreeView example that supports Shift Clicking and Up/Down Arrows.
"""ObjectBrowser
Based on: https://developers.maxon.net/?p=439"""
# ====== IMPORTS ====== #
import c4d
# ====== GLOBALS ====== #
ident = 5159
import c4d
print "************"*4
print "Results for", ident
for key, value in vars(c4d).iteritems():
if value == ident:
print(key)
@parijatmishra
parijatmishra / ddb_lsi_example.py
Created February 10, 2016 11:51
Using DynamoDB Local Secondary Indexes - example in Python and boto3
#!/usr/bin/env python
# ddb_lsi_example: A sample program to show how to use Local Secondary Indexes
# in DynamoDB, using Python and boto3.
#
# Copyright 2016 Parijat Mishra
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0