Skip to content

Instantly share code, notes, and snippets.

View darius-telycenas's full-sized avatar

Darius Telyčėnas darius-telycenas

  • Berlin
View GitHub Profile
@imjasonh
imjasonh / markdown.css
Last active January 3, 2025 20:15
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@Kindari
Kindari / bar.php
Last active November 11, 2022 00:28
<?php
class Bar extends Eloquent {
public function foo() {
return $this->belongsTo('Foo');
}
}
@sergigp
sergigp / gist:5504930
Last active January 25, 2021 10:12
small benchmark between curl, multicurl and file_get_contents. Results: CURL: 7.37 s // MULTI CURL: 1.93 s // FILE GET CONTENTS: 25.94 s
<?php
$data = array(
'http://www.marca.com',
'http://www.wowebook.be',
'http://www.meneame.net',
'http://www.google.com',
'http://www.elpais.es',
'http://www.reddit.com',
'http://www.digg.com',
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter