Skip to content

Instantly share code, notes, and snippets.

View cjanis's full-sized avatar

Craig Janis cjanis

View GitHub Profile
@cjanis
cjanis / popularposts.php
Created November 23, 2012 05:08
Using Facebook's Social Graph to Find A WordPress Blog's Most Popular Posts
<?php
// this goes into your theme's functions.php file
function popularPosts($limit) {
global $wpdb;
$posts = $wpdb->get_results("SELECT * FROM wp_posts WHERE $wpdb->posts.post_status='publish' AND $wpdb->posts.post_type='post'");
// get data for each post
$popular = array();
foreach ($posts as $post) {
@cjanis
cjanis / gist:3907067
Created October 17, 2012 18:01 — forked from tfausak/ios-8-web-app.html
iOS Standalone Web App Settings, Icons, and Startup Images
<!-- ios standalone web app -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- ios status bar appearance, options: black, black-translucent -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- ios icon, just one size because ios will scale it, remove "-precomposed" if you want ios to add effects -->
<link href="icon@144x144.png" sizes="144x144" rel="apple-touch-icon-precomposed">
<!-- ios startup images -->
@cjanis
cjanis / gist:fdaed8d5294e96f5ba98
Last active August 29, 2015 14:06 — forked from jedda/gist:4103604
Configuring RADIUS on OS X 10.9 Server
# turn on sudo
sudo su
# enter admin user password
# create the SACL for access to RADIUS
dseditgroup -q -o create -u <admin user> -n . com.apple.access_radius
# configure radiusd to log both successful and failed authentications
radiusconfig -setconfig auth yes
radiusconfig -setconfig auth_badpass yes