Skip to content

Instantly share code, notes, and snippets.

View omeroot's full-sized avatar
🎯
Focusing

Ömer Demircan omeroot

🎯
Focusing
View GitHub Profile
# ##### ##### ###### ####### ##### # ####### ####### #
# # # # # # # # # # # # # # # ##
# # # # # # # # # # # # # #
# # # #### # #### ###### ##### # #### # # # ##### #
####### # # # # # # # # # ####### # # #
# # # # # # # # # # # # # # # #
# # ##### ##### # # ####### ##### # # # ####### #####
//example object of document
YOURMODEL
{
_id
process : [{
_id : //mongo generate automatic
title : {type: Schema.Types.Mixed, default: {}},
description : {type: Schema.Types.Mixed, default: {}},
image : {type: String},
order : {type: Number}
}]

output of under command is your server ip address
$>dig +short A $(dig +short MX example.com | head -1 | cut -d' ' -f2)
if output is not ip address; create mx record
MX RECORD
indicates hostname pointing to your mail server ip address

create .ssh/config file
write in to
Host *
ServerAliveInterval 60

#VIM

kntrl + o //open command line in vim

:colorschema =>press tab and select something
:syntax enable

:set number => show line number

if you want new schema

function Huffman(text){
this.text = text;
this.coded = {};
this.node = {
right: null,
left: null,
freq: 0,
code:""
};
@omeroot
omeroot / caesar.js
Last active October 28, 2015 12:38
var instance = " abcdefgğhıijklmnoöpqrsştuüvyzwx".split("");
function encrypt(message, key){
message = message.split("");
for(var i = 0 ;i< message.length ; i++){
var index = instance.indexOf(message[i].toLowerCase());
message[i] = instance[ (index + key) % instance.length ];
}
var array = [];
function addElement(element){
for(var i = array.length ; i>0 && element <= array[i-1] ; --i){
array[i] = array[i-1];
}
array[i] = element;
}
addElement(5);// array => [5]
addElement(2);// array => [2,5]
var EventEmitter = require('events').EventEmitter;
EventEmitter.prototype.emit = function(type){
console.log(type);//output : end
var handler = this._events[type];
/**
*output: function(r, callback){
callback(r);
}
@omeroot
omeroot / index.ejs
Last active October 26, 2015 12:46
binary tree visualization on ejs template
<html>
<head></head>
<body>
<% var queue = [],l=null,r=null; %>
<% queue.push(btree) %>
<% while(queue.length > 0){ %>
<% var s = queue.shift() %>