Skip to content

Instantly share code, notes, and snippets.

View emanuelpoletto's full-sized avatar

Emanuel Poletto emanuelpoletto

View GitHub Profile

Keybase proof

I hereby claim:

  • I am emanuelpoletto on github.
  • I am emanuelpoletto (https://keybase.io/emanuelpoletto) on keybase.
  • I have a public key ASA8Ft6pHMXmold5ydHdMR4eMdMHLpZwCgAU5T-iz0m_XAo

To claim this, I am signing this object:

@emanuelpoletto
emanuelpoletto / minMeetingRooms.js
Created January 15, 2024 23:00
Given a list of time intervals in minutes of the day, return the minimum meeting rooms needed to accommodate them.
function minMeetingRooms(intervals) {
const startTimes = []
const endTimes = []
intervals.forEach(([start, end]) => {
startTimes.push(start)
endTimes.push(end)
})
startTimes.sort((a, b) => a - b)
@emanuelpoletto
emanuelpoletto / etc-vsftpd.conf
Last active September 26, 2022 19:26
FTPS setup with vsftpd on Ubuntu + httpd
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
<?php
/**
* XML to Associative Array Class
*
* Usage:
* $domObj = new xmlToArrayParser($xml);
* $domArr = $domObj->array;
*
* if($domObj->parse_error) echo $domObj->get_xml_error();
* else print_r($domArr);
body {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
-moz-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
-ms-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
/**
* Registers the 'profession' taxonomy for users. This is a taxonomy for the 'user' object type rather than a
* post being the object type.
*/
function my_register_user_taxonomy() {
register_taxonomy(
'profession',
'user',
array(
@emanuelpoletto
emanuelpoletto / WP: register custom post types
Last active December 20, 2015 06:19
WP: register custom post types
/**
* Registering custom post types
*/
function CUSTOMPREFIX_register_post_types() {
// product
$product_labels = array(
'name' => __( 'Products', 'CUSTOMTEXTDOMAIN' ),
'singular_name' => __( 'Product', 'CUSTOMTEXTDOMAIN' ),
'add_new' => __( 'Add New', 'CUSTOMTEXTDOMAIN' ),