This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Show the number of likes of a Facebook page | |
<?php | |
$url = "http://graph.facebook.com/YOURPAGENAME"; // enter your fb-sitename here | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$results = curl_exec($ch); | |
curl_close($ch); | |
$json = json_decode($results, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Show the number of subscribers of a Mailchimp Newsletter | |
* | |
* Contains "Mini MailChimp API v2 wrapper" by Drew McLellan | |
* to be found at https://github.com/drewm/mailchimp-api | |
*/ | |
class MailChimp | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Requires the "Twitter API" wrapper by James Mallison | |
* to be found at https://github.com/J7mbo/twitter-api-php | |
* | |
* The way how to get a follower count was posted by Amal Murali | |
* on http://stackoverflow.com/questions/17409227/follower-count-number-in-twitter | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I. "PERMANENT SOLUTION" | |
To show hidden files, open Terminal and enter: | |
defaults write com.apple.Finder AppleShowAllFiles TRUE [enter] | |
killall Finder | |
To hide 'em again, type: | |
defaults write com.apple.Finder AppleShowAllFiles FALSE [enter] | |
killall Finder [enter] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
// set the intro div automatically to full viewport height | |
$('.intro').height($(window).height()); | |
// ensure it stays this way when the window is resized | |
$(window).resize(function(){ | |
$('.intro').height($(window).height()); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in HTML: | |
// <div id="count"></div> | |
// <textarea id="#share-description"></textarea> | |
$(document).ready(function() { | |
var chars = 115; // 140 minus 25 (Twitter links (24 chars) plus 1 whitespace) | |
var left; | |
if ($("#share-description").val().length === 0) { | |
left = chars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$container-max-width: 72rem; /* from here on the columns start collapsing */ | |
$container-padding: 2rem; /* added because we don't like text sticking to the edges on mobiles */ | |
$columns: 3; /* number of columns @ the max-width of the container */ | |
$columns-gap: 4rem; /* space between the columns */ | |
/* pretty straightforward but here comes the magic: | |
the single column width is the result after | |
- the gap between the columns (always 1 less than the total number of columns) | |
- the container padding (applied on the left and on the right) | |
are subtracted from the width of the container and then |