Skip to content

Instantly share code, notes, and snippets.

@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 / 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}&name={name}&description={description}

@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 / 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')
});
.container {
transform-style: preserve-3d;
height:100px;
}
.center {
margin: 0;
position: relative;
top: 50%;
transform: translateY(-50%);
@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++)
@oguzhanaslan
oguzhanaslan / fit.js
Last active August 29, 2015 14:20 — forked from KrofDrakula/fit.js
// shorter vars for brevity
var a = image.naturalWidth,
b = image.naturalHeight,
c = maxImageWidth,
d = maxImageHeight,
r1 = a / b, // image aspect ratio
r2 = c / d; // container aspect ratio
// determine which dimension is the limiting factor
// according to the aspect ratio comparison and
(function(global) {
function Dither(container, width, height) {
this.container = container;
this.width = width;
this.height = height;
this.canvas = null;
this.image = null;
this.draw = this.draw.bind(this);
@oguzhanaslan
oguzhanaslan / uri.js
Last active August 29, 2015 14:20 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@oguzhanaslan
oguzhanaslan / beyaz-golge
Created April 27, 2015 10:46
yazının üstündeki beyaz gölgeli güzel şey
/* example: http://mnmly.com/ */
.seks {
top: 0;
left: 0;
width: 100%;
height: 100px;
position: fixed;
display: block;
content: "";
background: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(.6,rgba(255,255,255,0)));