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 / 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
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
@dr-dimitru
dr-dimitru / raw-count-usage.js
Created February 7, 2020 14:40
Efficient cursor count in Meteor.js
import { rawCount } from './raw-count.js';
rawCount(Meteor.users);
rawCount(Meteor.users, {'profile.active': true});
@dr-dimitru
dr-dimitru / .htaccess
Last active October 30, 2019 12:07
Installable PWA 101
# Add proper mime-type in Apache web server configuration
AddType application/manifest+json webmanifest
@dr-dimitru
dr-dimitru / twitter-follow-all-on-page.js
Last active May 5, 2019 21:34
Follow all accounts displayed on a page
// Better to execute this in Google Chrome
// 0. Go to twitter on the page where you would like to Follow other users (with [follow] buttons)
// 1. Right click on any place of page
// 2. Inspect Element
// 3. In opened panel - choose "console" tab
// 4. Copy-paste code you se below and hit "Enter" key
// Note: Twitter will block if you're going to follow a lot users instantly
// Script below adds between 1.5 and 4 seconds between each "follow" (button click), so you can start it and leave it for a while
(function(){
@dr-dimitru
dr-dimitru / medium-follow-all-on-page.js
Created March 13, 2019 06:33
Follow all users on open page at Medium.com
// Better to execute this in Google Chrome
// 0. Go to medium.com on the page where you would like to Follow other users
// 1. Right click on any place of page
// 2. Inspect Element
// 3. In opened panel - choose "console" tab
// 4. Copy-paste code you se below and hit "Enter" key
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
@dr-dimitru
dr-dimitru / curl-commands.sh
Last active October 6, 2018 18:57
Query website as GoogleBot using curl
# As default browser:
curl http://example.com
# As GoogleBot:
curl -A GoogleBot http://example.com
# As GoogleBot (old/deprecated) style:
curl -A GoogleBot http://example.com?_escaped_fragment_=
@dr-dimitru
dr-dimitru / .eslintignore
Last active October 4, 2018 08:38
Sublime Text 3 setup
android_bundle/
dev_bundle/
docs/
examples/
packages/
scripts/
tools/
!tools/*.js
!tools/isobuild/*.js
!tools/catalog/*.js