Skip to content

Instantly share code, notes, and snippets.

View hwclass's full-sized avatar

Barış Güler hwclass

View GitHub Profile
@hwclass
hwclass / mixin_pattern_example
Last active August 29, 2015 14:23
Mixin pattern example in Javascript.
var Person = function (name, age) {
this.name = name;
this.age = age;
}
function extend(destination, source) {
for (var k in source) {
if (source.hasOwnProperty(k)) {
destination[k] = source[k];
}
@hwclass
hwclass / singletonPattern-Config.js
Created July 2, 2015 08:28
Singleton Pattern (Config.js)
// models/Config.js
module.exports = (function () {
return function () {
var config = {
urls : {
tabs : {
address : '/#address',
payment : '/#payment'
}
},
@hwclass
hwclass / singletonPattern-base.js
Created July 2, 2015 08:29
Singleton Pattern (base.js)
// base.js
var Config = require(‘models/Config’);
var configInstance = new Config();
var config = configInstance.getConfig();
configInstance = null;
$(‘.error).html(config.messages.errors.default);
@hwclass
hwclass / Config.js
Created July 2, 2015 09:00
Design Patterns : Singleton Pattern
/**
* @fileoverview The base object to get configuration
* @author hwclass
*/
/**
* models/Config.js
* This object is used to fetch needed configuration parameters
*/
@hwclass
hwclass / Mediator.js
Created July 2, 2015 09:15
Design Patterns : Mediator Pattern
/**
* @fileoverview The mediator object file
* @author hwclass
*/
/**
* Mediator.js
* This object is used to fetch needed configuration parameters
*/
@hwclass
hwclass / Person.js
Created July 2, 2015 09:40
Design Patterns : Mixin Pattern
/**
* @fileoverview The sample js file for Person object
* @author hwclass
*/
/**
* Person.js
* This file contains an object to be a reference for new instances
*/
@hwclass
hwclass / testView.html
Last active August 29, 2015 14:24
Design Patterns : MV* Pattern
<span data-bind="text : testText"></span>
NodeJS’İN KONUMU / PERDE ARKASI / YARINI
Bir sunucu-taraflı Javascript platformu olarak Node ile bugüne kadar ne yaptık; neler yapılıyor;
tartışınca çok şey çıkacak; ama zaman almasın, daha konu çok
ES7
Daha 6'yı hallettik; 7'ye mi sıra geldi demesek? Decorator'lar, async metodlar, SIMD ve daha niceleri.
FFI: FOREIGN FUNCTION INTERFACE
Genel bir programlama tabirinden Node ile kullanımına kadar "kardeş" işlem parçalarınızı nasıl gerçekleştirirsiniz?
Yani Node içerisinde nasıl Rust çalıştırırsınız?
'use strict';
/**
* Mock : The data mocking object
* @noparam
*/
var Mock = function () {
var self = this;
<!DOCTYPE html>
<html>
<head>
<title>Hotel Fantastique</title>
<link rel="stylesheet" href="css.css" />
<!--[if lt IE 9]>
<script>
document.createElement('header');
document.createElement('nav');
document.createElement('section');