Skip to content

Instantly share code, notes, and snippets.

View ademilter's full-sized avatar

Adem ilter ademilter

View GitHub Profile
@marcusgadbem
marcusgadbem / social_counter.js
Created March 7, 2013 03:16
Social medias likes-count getter
function getFacebookCounts(url, commentElement, likesElement) {
var facebookUrl = "https://api.facebook.com/method/fql.query?format=json&query=select%20total_count,like_count,comment_count,share_count,click_count%20from%20link_stat%20where%20url='" + url + "'";
$.getJSON(facebookUrl, function (data) {
$(commentElement).text(data[0].comment_count);
$(likesElement).text(data[0].total_count);
});
}
function getTwitterCount(url, countElement) {
var twitterUrl = 'http://cdn.api.twitter.com/1/urls/count.json?url=' + url + '&callback=?';
@mustafauysal
mustafauysal / br.php
Created September 13, 2013 14:08
please don't break me!
<?php
add_filter('the_content', 'remove_br_tags');
function remove_br_tags($content) {
return preg_replace('/<br(\s+)?\/?>/i', "\n", $content);
}
@mustafauysal
mustafauysal / wp-title-hack.php
Created December 5, 2013 19:33
super-duper title hack for Adem's blog :)
<?php echo urldecode(str_replace('%26%23215%3B','x', urlencode(get_the_title()))); ?>
@Lewiscowles1986
Lewiscowles1986 / lc-svg-upload.php
Last active August 4, 2016 13:45
SVG Media Plugin for WordPress (Works since 4.1.2!)
<?php
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on
@emir
emir / challenge.md
Last active November 7, 2016 12:07
Medium Challenge (Kasım)
@tomhodgins
tomhodgins / snippets.cson
Last active December 19, 2016 15:07
Atom snippets file! This is a collection of my most often used lines of code, as well as a few other examples I want to have ready at a moment's notice. These snippets focus on building HTML from scratch, linking in good web fonts, and setting up responsive styles for your pages.
# The Mad CSScientist's Snippets
# written by Tommy Hodgins: https://gist.github.com/tomhodgins/bfca1b640d10427072c1
#
# This is a collection of my most often used lines of code, as well as
# a few other examples I want to have ready at a moment's notice.
# These snippets focus on building HTML from scratch, linking in
# good web fonts, and setting up responsive styles for your pages.
#
# An example single-line snippet:
#
@vigo
vigo / ruby-tips.md
Created November 4, 2012 22:50
Ruby Tips

Ruby Tips

Genel

  • Herşey bir Object (Nesne)
  • Her Object BasicObjectden türemiş. (Objective-C NSObject gibi...)
  • Object.methods ile o nesneye ait tüm method'lar
  • Object.methods.inspect string olarak method'lar
  • Mutlaka bir şey geriye döner. Hiçbir şey dönmese nil döner.

Style Guide

@lou
lou / gmap-fullscreen.js
Created January 2, 2012 12:10
Google map Fullscreen with jQuery
$(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), {});
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var googleMapWidth = $("#map_canvas").css('width');
var googleMapHeight = $("#map_canvas").css('height');
map.setCenter(newyork);
$('#enter-full-screen').click(function(){
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@ekryski
ekryski / app.js
Last active February 19, 2019 20:20
How to use socket.io in React Native
// You need to set `window.navigator` to something in order to use the socket.io
// client. You have to do it like this in order to use the debugger because the
// debugger in React Native runs in a webworker and only has a getter method for
// `window.navigator`.
window.navigator.userAgent = 'ReactNative';
// Need to require instead of import so we can set the user agent first
// This must be below your `window.navigator` hack above
const io = require('socket.io-client/socket.io');
const socket = io('http://chat.feathersjs.com', {