Skip to content

Instantly share code, notes, and snippets.

{"meta":{"code":200,"response_time":{"time":1.15,"measure":"seconds"}},"notifications":{"type":"notifications","unread_count":{"comments":0,"toasts":0,"friends":0,"messages":0,"news":0}},"response":{"mg":true,"checkins":{"count":25,"items":[{"checkin_id":43080032,"created_at":"Wed, 28 Aug 2013 07:13:17 +0000","checkin_comment":"Free after work beer.","rating_score":2,"user":{"uid":362611,"user_name":"Abalster9","first_name":"Alan","last_name":"Balster","location":"Kansas City","url":"","is_supporter":0,"relationship":"friends","bio":"","user_avatar":"https:\/\/untappd.s3.amazonaws.com\/profile\/111c5e9fdb9e014ad4c12740f93c0fd5_thumb.jpg"},"beer":{"bid":3834,"beer_name":"Coors Light","beer_label":"https:\/\/untappd.s3.amazonaws.com\/site\/beer_logos\/beer-coorsLight.jpg","beer_style":"American Light Lager","beer_abv":4.2,"auth_rating":0,"wish_list":false,"beer_active":1},"brewery":{"brewery_id":399,"brewery_name":"Coors Brewing Company","brewery_label":"https:\/\/untappd.s3.amazonaws.com\/site\/brewery_logos\/
public abstract class ViewModel : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name) {
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
@auniverseaway
auniverseaway / gist:8445523
Created January 15, 2014 21:54
Get all images attached to a wordpress post except for the thumbnail image.
function slideshow_hero($postid) {
$thumb_ID = get_post_thumbnail_id($postid);
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'image',
'post_status' => null,
'exclude' => $thumb_ID,
'post_parent' => $postid);
@auniverseaway
auniverseaway / gist:acafd834c20d7df3d329
Last active August 29, 2015 14:01
RestSharp vs PortableRest (GET / POST)
// POST Working in RestSharp
var client = new RestClient(url);
var request = new RestRequest("/oauth/access_token?client_id=" + clientid + "&client_secret=" + clientsecret, Method.POST);
request.AddParameter("grant_type", "password");
request.AddParameter("username", username);
request.AddParameter("password", password);
client.ExecuteAsync(request, response =>
{
// Do stuff with the response
});
public class SampleDataItem
{
public SampleDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content)
{
this.UniqueId = uniqueId;
this.Title = title;
this.Subtitle = subtitle;
this.Description = description;
this.ImagePath = imagePath;
this.Content = content;
foreach ($podcasts as $podcast) {
$ourPodcast = Podcast::where('itunes_id', '=', $podcast->trackId)->first();
// If we don't have a record of the podcast, go ahead and create it.
if (is_null($ourPodcast))
{
$return[] = App::make('PodcastsController')->createFromItunes($podcast);
} else {
$return[] = $ourPodcast;
}
}
@auniverseaway
auniverseaway / gist:2ffb4799a6f05eaa997e
Last active August 29, 2015 14:04
API Controller
public function getRecentEpisodes()
{
$podcastid = Input::get('podcast_id');
$podcast = Podcast::find($podcastid);
$episode = Podcast::find($podcastid)->episodes()->first();
if(!$episode)
{
@auniverseaway
auniverseaway / gist:fcfb94f2b924ccacbc92
Created November 25, 2014 16:11
EpisodeView Play_Tapped
if(App.EpisodeViewModel.IsOpen && App.EpisodeViewModel.IsPlaying)
{
// Pause
Debug.WriteLine("Pause");
App.EpisodeViewModel.Pause();
}
else if (App.EpisodeViewModel.IsOpen)
{
// Play current
Debug.WriteLine("Play Current");
public function getHash($hash)
{
$binary = $this->base64url_decode($hash);
$values = unpack("LS", $binary);
var_dump(bin2hex($binary));
var_dump($values);
$episodeId = $values['S'];
@auniverseaway
auniverseaway / gist:1d48b8e7ded0652ced0f
Created December 17, 2014 17:12
Image Class tying into Imagine Framework on Laravel
<?php namespace App\Services;
use Config, File, Log;
class Image {
/**
* Instance of the Imagine package
* @var Imagine\Gd\Imagine
*/