Skip to content

Instantly share code, notes, and snippets.

View dr-dimitru's full-sized avatar
👨‍💻
get 💩 done

dr.dimitru dr-dimitru

👨‍💻
get 💩 done
View GitHub Profile
@dr-dimitru
dr-dimitru / Social RESTful URLs snippet.md
Last active January 17, 2026 16:11
Social links, +1s and shares using only HTML (no JS)
@dr-dimitru
dr-dimitru / poll.md
Created January 29, 2018 22:33
YCombinator Poll

Company name:

Company url, if any:

If you have a demo, what's the url? For non-software, demo can be a video.

Describe your company in 50 characters or less.

What is your company going to make?

Which category best applies to your company?

Is this application in response to a YC RFS?

Where do you live now, and where would the company be based after YC? (List as City A, Country A / City B, Country B.)

FOUNDERS

@dr-dimitru
dr-dimitru / minify_function.php
Last active May 16, 2024 04:59
HTML MINIFY RegEx
$re = '%# Collapse whitespace everywhere but in blacklisted elements.
(?> # Match all whitespans other than single space.
[^\S ]\s* # Either one [\t\r\n\f\v] and zero or more ws,
| \s{2,} # or two or more consecutive-any-whitespace.
) # Note: The remaining regex consumes no text at all...
(?= # Ensure we are not in a blacklist tag.
[^<]*+ # Either zero or more non-"<" {normal*}
(?: # Begin {(special normal*)*} construct
< # or a < starting a non-blacklist tag.
(?!/?(?:textarea|pre|script)\b)
@dr-dimitru
dr-dimitru / .htaccess
Created October 30, 2013 16:34
.htaccess file for Laravel 4 and Laravel 3 | For /public folder
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@dr-dimitru
dr-dimitru / createRamDisk.sh
Created November 26, 2013 22:43
Simple Terminal command to mount RAM Disk on Mac OS X
#!/bin/sh
diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nomount ram://8388608`
@dr-dimitru
dr-dimitru / accounts_client.js
Created March 9, 2021 11:50
Meteor Accounts Enhancements
// !!! THIS IS META CODE, NOT A REAL SUGGESTION TO A CODEBASE
// JUST VERY SIMPLIFIED FORM OF PROPOSAL
Meteor._user = new ReactiveVar(null);
Meteor._userId = new ReactiveVar(null);
Tracker.autorun(() => {
Meteor._user.set(Meteor.user() || null);
});
Tracker.autorun(() => {
Meteor._userId.set(Meteor.userId() || null);
@dr-dimitru
dr-dimitru / client.conf
Created February 22, 2021 17:39
Proxmox host/client iface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.1.2
netmask 255.255.255.0
gateway 10.0.1.1
@dr-dimitru
dr-dimitru / mongodb-collections-sizes.js
Last active January 26, 2021 19:21
Show each collection size in MongoDB
var getReadableFileSizeString = function(fileSizeInBytes) {
var i = -1;
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
};
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 0.3
systemLog:
destination: file
@dr-dimitru
dr-dimitru / mongodb.conf
Created February 7, 2020 14:50
MongoDB configuration we use on Meteor.js
# Our servers has 32GB of RAM
storage:
dbPath: /data/mongo
journal:
enabled: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 8