One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
<?php | |
/* | |
* Plugin Name: LearnPress to WP Rest API | |
* Plugin URI: https://www.webapp.bg/wp-extensions/learnpress-rest-api | |
* Description: A plugin to add endpoints for LearnPress to WP REST API | |
* Version: 1.0 | |
* Author: Marin Stoyanov | |
* Author URI: https://www.webapp.bg/ | |
* License: GPL2 | |
*/ |
var groupBy = function(data, key) { // `data` is an array of objects, `key` is the key (or property accessor) to group by | |
// reduce runs this anonymous function on each element of `data` (the `item` parameter, | |
// returning the `storage` parameter at the end | |
return data.reduce(function(storage, item) { | |
// get the first instance of the key by which we're grouping | |
var group = item[key]; | |
// set `storage` for this instance of group to the outer scope (if not empty) or initialize it | |
storage[group] = storage[group] || []; | |
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": true | |
} | |
} |
# maximum capability of system | |
user@ubuntu:~$ cat /proc/sys/fs/file-max | |
708444 | |
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 200000 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf |
Import-Module Dism | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45 | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics |
import * as mongoose from 'mongoose'; | |
export let Schema = mongoose.Schema; | |
export let ObjectId = mongoose.Schema.Types.ObjectId; | |
export let Mixed = mongoose.Schema.Types.Mixed; | |
export interface IHeroModel extends mongoose.Document { | |
name: string; | |
power: string; |
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
function getGreetingTime (m) { | |
var g = null; //return g | |
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return. | |
var split_afternoon = 12 //24hr time to split the afternoon | |
var split_evening = 17 //24hr time to split the evening | |
var currentHour = parseFloat(m.format("HH")); | |
if(currentHour >= split_afternoon && currentHour <= split_evening) { |