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 / Meteor_Boilerplate_Structure
Last active August 29, 2015 14:08
Meteor.js boilerplate files and folders structure
myAwesomeApp
|-client
| |-lib #Only Client libraries
| |-js
| |-templates
|-collections #Define, Publish & Subscribe collections
|-lib #Isomorphic (Client + Server) libraries
|-public (or static) #files & folders avaliable via http
| |-css
| |-other
@dr-dimitru
dr-dimitru / generateUsers.js
Last active August 29, 2015 14:09
Meteor Generate random users with names
var generateUsers = function(x){
var lastnames = ['Brown', 'Black', 'Green', 'Aaberg', 'Aagard', 'Abdella', 'Abebe', 'Caccamo', 'Caccavale', 'Caccese', 'Cacchione', 'Caccia', 'Cacciatore', 'Easley', 'Easlick', 'Easom', 'Eason', 'East', 'Eastburn', 'Ines', 'Infante', 'Infanti', 'Infantino', 'Infield','Infinger', 'Kaliszewski', 'Kalita', 'Kalivas', 'Kalivoda', 'Kalk', 'Kalka', 'Umpleby', 'Umscheid', 'Umstead', 'Umsted', 'Un', 'Unangst', 'Zediker', 'Zee', 'Zeeb', 'Zeedyk', 'Zeek', 'Zeeman'];
var firstnames = ['Mohamed', 'Youssef', 'Ahmed', 'Mahmoud', 'Mustafa', 'Yassin', 'Taha', 'Khaled', 'Hamza', 'Bilal', 'Ibrahim', 'Hassan', 'Hussein', 'Karim', 'Tareq', 'Abdel-Rahman', 'Ali', 'Omar', 'Halim', 'Murad', 'Selim', 'Abdallah', 'Alex', 'Alexander', 'Carter', 'Charlie', 'David', 'Jackson', 'James', 'Jase', 'Joseph', 'Wyatt', 'Charles', 'Clark', 'Cooper', 'Daniel', 'Drake', 'Dylan', 'Edward', 'Eli', 'Elijah', 'Emerson', 'Evan', 'Felix', 'Gabriel', 'Gavin', 'Gus', 'Isaac', 'Isaiah', 'Jacob', 'Jax', 'Kai', 'Kai
@dr-dimitru
dr-dimitru / readme.md
Last active August 29, 2015 14:10
The javascript comma operator vs. semicolon operator
@dr-dimitru
dr-dimitru / readme.md
Last active August 29, 2015 14:10
jQuery Selectors comparison
@dr-dimitru
dr-dimitru / readme.md
Last active August 29, 2015 14:10
In function scope: this vs. object name reference
@dr-dimitru
dr-dimitru / readme.md
Last active August 29, 2015 14:10
Fastest If Callback
@dr-dimitru
dr-dimitru / etc_nginx_nginx.conf
Last active August 29, 2015 14:16
PHP5-FMP Configuration example with cache for laravel or drupal
user www-data;
worker_processes 2; #THIS VALUE SHOULD BE EQUAL TO PROCESS CORES QTY
pid /var/run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
}
http {
@dr-dimitru
dr-dimitru / like_all_on_page.js
Last active August 25, 2017 12:07
Like all posts on page at vk.com
// Better to execute this in Google Chrome
// 0. Go to vk.com on page where you would like to like all posts
// 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';
newscript.async = true;
@dr-dimitru
dr-dimitru / server.coffee
Created October 31, 2015 15:55
instagram example
# @var {Object} bound - Meteor.bindEnvironment aka Fiber wrapper
bound = Meteor.bindEnvironment (callback) -> return callback()
ServiceConfiguration.configurations.remove service: "instagram"
ServiceConfiguration.configurations.insert
service: "instagram"
clientId: "clientId"
requestPermissions: ['basic', 'likes', 'relationships', 'comments']
scope: ['basic', 'likes', 'relationships', 'comments']
@dr-dimitru
dr-dimitru / readme.md
Created March 16, 2016 23:00
Speed-test of trimming float number

Test trim-float

var x = 5.0364342423;
parseFloat(x.toFixed(2));
//VS
Math.round(x*100)/100; // 97% faster