Skip to content

Instantly share code, notes, and snippets.

@oguzhanaslan
oguzhanaslan / geturlparameters.js
Created May 6, 2015 08:09
geturlparameters.js
function GetURLParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
.container {
transform-style: preserve-3d;
height:100px;
}
.center {
margin: 0;
position: relative;
top: 50%;
transform: translateY(-50%);
@oguzhanaslan
oguzhanaslan / dropdown-menu.js
Created June 2, 2015 12:17
Bootstrap Dropdown menu clickable in navbar
$('body').on('show.bs.dropdown', function (e) {
$(e.relatedTarget).addClass('disabled')
});
$('body').on('hide.bs.dropdown', function (e) {
$(e.relatedTarget).removeClass('disabled')
});
@oguzhanaslan
oguzhanaslan / vimrc-front-end
Last active August 29, 2015 14:27 — forked from mrmrs/vimrc-front-end
VIMRC for vim beginners that are Front End Developer types.
set nocompatible
set title
set number " Show line numbers
set history=1000 " Default is 20, I'd rather set this to ∞
set nofoldenable " Don't fold shit
set laststatus=2 " Always show file status line
set encoding=utf-8
setlocal tabstop=4
setlocal shiftwidth=4
@oguzhanaslan
oguzhanaslan / Sharer.md
Last active August 27, 2015 10:13 — forked from Silfen/Sharer.md
Sharer

Twitter

http://twitter.com/share?text={description}&url={url}&hashtags={hashtags}

Facebook

http://www.facebook.com/share.php?u={url}

Pinterest

http://pinterest.com/pin/create/button/?url={url}&media={picture_url}&description={description}

Tumblr

http://www.tumblr.com/share/link?url={url}&amp;name={name}&amp;description={description}

@oguzhanaslan
oguzhanaslan / gist:b46ba6d0d78dca3d6433
Last active September 2, 2015 10:20 — forked from ademilter/gist:8972161
share & share count
// SHARE COUNT
$.getJSON("https://graph.facebook.com/fql?q=SELECT like_count FROM link_stat WHERE url=" + encodeURIComponent('"' + Screenshot.Meta.full_url + '"') + " &callback=?", function(t) {
t.data[0] && $("#share-button-fb .shot-social-count").html(shorterTotal(t.data[0].like_count))
})
$.getJSON("http://cdn.api.twitter.com/1/urls/count.json?url=" + encodeURIComponent(Screenshot.Meta.full_url) + "&callback=?", function(t) {
t.count && $("#share-button-twitter .shot-social-count").html(shorterTotal(t.count))
})
@oguzhanaslan
oguzhanaslan / test
Created December 26, 2015 12:31
test
C:\FTB\MinecraftLog.txt: written by FTB Launcher
[14:17:11] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[14:17:11] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[14:17:11] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[14:17:11] [main/INFO] [FML]: Forge Mod Loader version 7.99.36.1558 for Minecraft 1.7.10 loading
[14:17:11] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_66, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_66
[14:17:11] [main/INFO] [FML]: [AppEng] Core Init
[14:17:11] [main/WARN] [FML]: The coremod codechicken.core.launch.CodeChickenCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft
[14:17:12] [main/WARN] [FML]: The coremod cofh.asm.LoadingPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft
[14:17:12]
@oguzhanaslan
oguzhanaslan / 1-proposal.md
Created June 27, 2016 13:22 — forked from JedWatson/1-proposal.md
Proposal: adding reverse-relationship population to Mongoose (as implemented in KeystoneJS)

I've developed a useful feature in KeystoneJS that lets you populate a relationship from either side, while only storing the data on one side, and am looking for feedback on whether it is something that could / should be brought back into mongoose itself. (It might be possible to add as a separate package but I suspect there'd be too much rewriting of mongoose internals for that to be a good idea).

I've added this as an issue in mongoose for consideration: #1888 but am leaving this gist in place because the examples are easier to read.

I've used Posts and Categories as a basic, contrived example to demonstrate what I'm talking about here; in reality you'd rarely load all the posts for a category but there are other real world cases where it's less unreasonable you'd want to do this, and Posts + Categories is an easy way to demo it.

The problem

The built-in population feature is really useful; not just for

@oguzhanaslan
oguzhanaslan / auth.js
Created July 3, 2016 21:10
Angular JWT localStorage
(function () {
'use strict';
angular
.module('app')
.factory('AuthenticationService', Service);
function Service($http, $localStorage) {
var service = {};
@oguzhanaslan
oguzhanaslan / Modal.vue
Created November 15, 2016 12:57
ahmetsulek panda
<template>
<div id="modal" v-if="show">
<div class="modal-mask" @click="close" transition="modal">
<div class="modal-container" @click.stop>
CONTENT
</div>
</div>
</div>
</template>