Skip to content

Instantly share code, notes, and snippets.

View richardblondet's full-sized avatar

Richard Blondet richardblondet

View GitHub Profile
@richardblondet
richardblondet / osx-for-pentesting.sh
Created January 2, 2023 19:36 — forked from gabemarshall/osx-for-pentesting.sh
A fork of osx-for-hackers for my personal pentesting setup preferences
# OSX for Pentesting (Mavericks/Yosemite)
#
# A fork of OSX for Hackers (Original Source: https://gist.github.com/brandonb927/3195465)
#!/bin/sh
# Ask for the administrator password upfront
echo "Have you read through the script prior to running this? (y or n)"
read bcareful
@richardblondet
richardblondet / virtual-mind-answer-a.js
Last active November 21, 2020 02:31
VirtualMind test answers
/** New API */
const PlayerService = {
getPlayerTeam: (playerId) => {
return new Promise((resolve, reject) => {
$.ajax({
url: `/player/${playerId}/team`,
success: (data) => {
resolve(data)
},
error: (error) => {
@richardblondet
richardblondet / README.md
Last active December 20, 2019 14:53
Wordpress SQL for adding admin user

Create a Wordpress Admin user with SQL Query

INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Your Name', 'test@yourdomain.com', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name');
 
 
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
 
 
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
@richardblondet
richardblondet / README.md
Last active May 3, 2024 10:02
Create a simple API backend with Google App Script and a Spreadsheet

Google App Script CRUD

Inspired by this gist.

Getting Started

  1. Create a new App Script project.
  2. Paste the content of the file google-app-script-crud.gs in the default Code.gs file.
  3. Create a new Spreadsheet.
  4. Copy the Spreadsheet ID found in the URL into the variable SHEET_ID located in line 1 of your file.
@richardblondet
richardblondet / README.md
Created August 4, 2019 03:18 — forked from nyancodeid/README.md
Make RESTful API with Google Apps Script and SpreadSheet
@richardblondet
richardblondet / .htaccess
Last active January 28, 2019 17:49
Wordpress Docker Contairnerization
# Local development file size upload
php_value upload_max_filesize 5000M
php_value post_max_size 2400M
php_value memory_limit 600M
php_value max_execution_time 600
php_value max_input_time 300
# Disabling anoying warnings
# php_flag display_startup_errors off
# php_flag display_errors off
@richardblondet
richardblondet / FormatUnicorn.js
Created September 17, 2018 13:53
Stack Overflow own formatting function for the String prototype called formatUnicorn. Seen {@link https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format}
String.prototype.formatUnicorn = String.prototype.formatUnicorn || function () {
"use strict";
var str = this.toString();
if (arguments.length) {
var t = typeof arguments[0];
var key;
var args = ("string" === t || "number" === t) ?
Array.prototype.slice.call(arguments)
: arguments[0];
@richardblondet
richardblondet / parse_shortcodes_attributes.php
Last active September 17, 2018 13:57
Takes a shortcode and content and returns an array of the parsed attributes of given shortcode
/**
* Takes a shortcode and content and returns an array of the partsed attributes of given shortcode
* @param string $shortcode the shortcode in context
* @param string $content the content where shortcode is found
* @return bool|array FALSE if the given conditions are not met|ARRAY of key-values for the shortcode
* @author Richard Blondet <http://richardblondet.com/>
*/
function parse_shortcodes_attributes( $shortcode, $content = '' ) {
if( empty( $content ) ) return FALSE;
@richardblondet
richardblondet / woocommerce-paypal-enable-unsupported-currency.php
Last active February 1, 2023 13:06
Enable unsupported currency to Woocommerce
/**
* @author: Svetto <https://devseon.com/en/wordpress-tutorials/woocommerce-add-a-paypal-unsupported-currency>
*/
add_filter( 'woocommerce_paypal_supported_currencies', 'add_a_paypal_valid_currency' );
function add_a_paypal_valid_currency( $currencies ) {
array_push ( $currencies , 'DOP' ); // DOP = Dominican Peso. Please change to your country code here.
return $currencies;
}
@richardblondet
richardblondet / spreadsheet_to_email.gs
Last active January 17, 2023 16:47
Send Emails from messages from Spreadsheet
function sendEmail() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var currentsheet = spreadsheet.getSheetByName('Sheet1');
var data = currentsheet.getDataRange().getValues();
var html = HtmlService.createTemplateFromFile('TEMPLATE'); // create a html file, named template case sentitive
var date = new Date();
//loop over each line