Skip to content

Instantly share code, notes, and snippets.

View Cengizism's full-sized avatar
🧿

Cengiz Ulusoy Cengizism

🧿
View GitHub Profile
@Cengizism
Cengizism / gist:0a69bb608a1d41202389
Created July 22, 2015 13:30
A helper, internal data structure that acts as a map but also allows getting / removing * elements in the LIFO order
/**
* A helper, internal data structure that acts as a map but also allows getting / removing
* elements in the LIFO order
*/
.factory('$$stackedMap', function () {
return {
createNew: function () {
var stack = [];
return {
WinJS.Namespace.define('MyFactory', {
2.Car: WinJS.Class.define(
3. // Constructor
4. function (color, make) {
5. this.color = color;
(function () {
2. "use strict";
3.
4. WinJS.Binding.optimizeBindingReferences = true;
5.
@Cengizism
Cengizism / gist:f5bbf7a1ef7dfaa8bc7b
Created April 6, 2014 13:08
MailChimp Template : Dentist
<html>
<head>
<title>*|MC:SUBJECT|*</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<style type="text/css">
body,#wrap{
text-align:center;
margin:0px;
background-color:#FFFEF8;
Services.factory("LawnchairFactory", function($window, $log, $parse) {
return function(name, config) {
var collection = {};
var array = [];
var isArray = config && config.isArray;
var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id");
var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity;
var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity;
function getEntryId(entry){
@Cengizism
Cengizism / nodejs - events
Created March 23, 2014 06:51
nodejs - events
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
@Cengizism
Cengizism / angular-geolocation
Created March 19, 2014 12:28
angular-geolocation
angular.module('ngGeolocation',[])
.constant('options',{})
.factory('geolocation',
["$q","$rootScope","options",
function ($q , $rootScope , options){
return {
position: function () {
var deferred = $q.defer()
navigator.geolocation.getCurrentPosition(function (pos) {
$rootScope.$apply(function () {
@Cengizism
Cengizism / change route directive
Created December 7, 2013 16:06
change route directive
'use strict';
var directives = angular.module('guthub.directives', []);
directives.directive('butterbar', ['$rootScope',
function($rootScope) {
return {
link: function(scope, element, attrs) {
element.addClass('hide');
@Cengizism
Cengizism / redirect with meta
Created December 7, 2013 15:52
redirect with meta
<!doctype html>
<html><head>
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0;url=./test.html">
</head><body>
Redirecting...
</body></html>
@Cengizism
Cengizism / responsive-template.css
Created November 17, 2013 13:51
responsive-template.css
@media (min-width: 768px) and (max-width: 979px) {
}
@media (max-width: 767px) {
}
@media (min-width: 1200px) {
}
@media (min-width: 768px) and (max-width: 979px) {
}
@media (max-width: 767px) {