Skip to content

Instantly share code, notes, and snippets.

View anil3a's full-sized avatar
🏠
Working from home

Anil Prajapati anil3a

🏠
Working from home
View GitHub Profile
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt
echo.
echo -----
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
@toledox82
toledox82 / mailchimp.php
Last active July 21, 2023 18:06
PHP cURL function to add subscriber to MailChimp API 3.0
<?php
$data = [
'email' => $email,
'status' => 'subscribed',
'firstname' => $fname,
'lastname' => $lname
];
function syncMailchimp($data) {
$apiKey = 'XXX';
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@spsaucier
spsaucier / gist:6044070
Created July 20, 2013 06:25
Wordpress - Import Posts - Assign to Author
$('#authors > li').each(function(){
var textstring = $(this).find('strong').text().split(" (");
console.info(textstring[0]);
$(this).find('select[name^=user_map] option').filter(function() {
return $(this).text() == textstring[0];
}).prop('selected', true);
});