Skip to content

Instantly share code, notes, and snippets.

View muratcorlu's full-sized avatar

Murat Çorlu muratcorlu

View GitHub Profile
{
init: function(elevators, floors) {
var upWaiters = {},
downWaiters = {},
idleElevators = [],
floorCount = floors.length,
arrayUnique = function(a) {
return a.reduce(function(p, c) {
if (p.indexOf(c) < 0) p.push(c);
return p;
@muratcorlu
muratcorlu / detay.html
Created October 24, 2015 18:29
Synaps Seçim sistemi embed kodları
<div synaps-secim></div>
@muratcorlu
muratcorlu / install.sh
Last active April 14, 2016 09:47
Prerender Installation to Debian with Nginx Proxy and Caching
# Prerender kurulumu
sudo locale-gen UTF-8
sudo apt-get update
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential libfontconfig nginx-extras
sudo npm install -g phantomjs
sudo npm install -g prerender
sudo npm install -g pm2
@muratcorlu
muratcorlu / nginx.conf
Created November 3, 2017 23:42
Serve static websites by dynamically mapping domain names and folders with nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/${host}/public;
index index.html;
server_name _;
gzip on;
@muratcorlu
muratcorlu / gamespark-realtime.ts
Last active October 11, 2018 22:34
GameSpark SDK for TypeScript (for using with NativeScript)
const OpCodes = {
LOGIN_RESULT: -1,
PING_RESULT: -3,
UDP_CONNECT_MESSAGE: -5,
PLAYER_READY_MESSAGE: -7,
PLAYER_CONNECT_MESSAGE: -101,
PLAYER_DISCONNECT_MESSAGE: -103,
}
export class Connection {
@muratcorlu
muratcorlu / README.md
Created February 9, 2020 20:12
Node Simple Logger

Simple logging utility for NodeJS v8+.

const { warn } = require('./logger');

warn('Something');

You can set log level via LOG_LEVEL env variable.

@muratcorlu
muratcorlu / README.md
Created March 10, 2022 20:18
Running self-hosting mail server with Poste.io and docker-compose
@muratcorlu
muratcorlu / Readme.md
Last active January 16, 2023 08:38
Custom Element Serializer

Getting an HTML snapshot of current DOM including Custom Elements

This is an attempt to get HTML snapshot of current document in browser to report current state to server, to get a screenshot on the server without running JS