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
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
@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 365 -out %domain%\server.crt
echo.
echo -----
@anil3a
anil3a / gist:06c08bcdf262a1c0efe1990b44ae0583
Created May 15, 2017 06:24 — forked from spsaucier/gist:6044070
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);
});
/**
* 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();
@anil3a
anil3a / Australian Table Rates
Created June 7, 2016 02:02
Add support for shipping in Australia for Magento table rates
// table rate CSV example:
"Country","Region/State","Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
"AU","*","*","250","0"
"AU","VIC","*","0","10"
"AU","NSW","*","0","12"
"AU","QLD","*","0","12"
"AU","ACT","*","0","12"
"AU","NT","*","0","12"
"AU","WA","*","0","12"
@anil3a
anil3a / app.js
Created November 1, 2013 10:08 — forked from pixelhandler/app.js
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@anil3a
anil3a / api.js
Created November 1, 2013 09:58 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@anil3a
anil3a / api.js
Created October 31, 2013 09:59 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@anil3a
anil3a / api.js
Created October 31, 2013 09:57 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');