Skip to content

Instantly share code, notes, and snippets.

View xximjasonxx's full-sized avatar

Jason Farrell xximjasonxx

View GitHub Profile
@interface PredictionHistoryEntry : NSObject
@property (nonatomic) int year;
@property (nonatomic, strong) NSMutableArray *weeks;
@end
completion:^(id result, NSHTTPURLResponse *response, NSError *error) {
if (error == nil) {
NSMutableArray *historyArray = [[NSMutableArray alloc] init];
NSDictionary *resultDictionary = (NSDictionary *)result;
@xximjasonxx
xximjasonxx / One
Created July 30, 2014 16:03
Problem with creating a custom Android view - nothing showing
var root = (LinearLayout)FindViewById(Resource.Id.scrollViewRoot);
foreach (var entry in _dayList)
{
View dayButtonLayout = LayoutInflater.From(_context).Inflate(Resource.Layout.day_button_layout, root, false);
DayButton dayButton = new DayButton(_context, entry, dayButtonLayout);
root.AddView(dayButton);
}
// Day Button class
public abstract class SplashView : MvxViewController
{
public new SplashViewModel ViewModel
{
get { return (SplashViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}
public SplashView(string viewName, NSBundle bundle) : base(viewName, bundle)
{
var publicationsPath = GetPublicationsPath();
if (!Directory.Exists (publicationsPath))
{
Directory.CreateDirectory (publicationsPath);
}
if (0 == Directory.GetFiles (publicationsPath).Length)
{
Logger.Debug ("no downloaded publications or publications got wiped");
publicationMutex.WaitOne ();
var publicationsPath = GetPublicationsPath();
if (!Directory.Exists (publicationsPath))
{
Directory.CreateDirectory (publicationsPath);
}
if (0 == Directory.GetFiles (publicationsPath).Length)
{
Logger.Debug ("no downloaded publications or publications got wiped");
publicationMutex.WaitOne ();
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
var Q = require("q");
exports.get = function(request, response) {
var userId = request.user.userId;
var weekOf = request.query.weekForDate;
// make a query to get the total points for the user for the week
var weekDataPromise = getWeekFor(weekOf);
weekDataPromise.then(function(result) {
@xximjasonxx
xximjasonxx / gist:8425012
Created January 14, 2014 20:24
Error parsing the JSON, the created body seems to not be an object
{"ss":[["Sun","1:00","Final",,"ABC","21","DEF","20",,,"56077",,"REG17","2013"],["Sun","1:00","Final",,"YYY","17","XXX","34",,,"56079",,"REG17","2013"],["Sun","1:00","Final",,"DDD","10","EEE","30",,,"56081",,"REG17","2013"]]}
request({
url: "http://www.nfl.com/liveupdate/scorestrip/scorestrip.json",
json: true
}, function(error, response, body) {
if (!error && response.statusCode == 200) {
body = body.replace(/,+/g, ',');
var key = Object.keys(body)[0];
console.log(key);
public ObservableCollection<TemperatureReading> ChartDataSource
{
get { return _datasource; }
set
{
if (value != null)
{
if (value.Count == 0)
{
_datasource = value;
@xximjasonxx
xximjasonxx / main.tf
Created February 24, 2019 04:34
Terraform - Project01 - Azure App Service Def
resource "azurerm_app_service" "test" {
name = "test-service123456789"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
app_settings {
WEBSITES_ENABLE_APP_SERVICE_STORAFE = false
DOCKER_REGISTRY_SERVER_URL = "${data.azurerm_container_registry.test.login_server}"
DOCKER_REGISTRY_SERVER_USERNAME = "${data.azurerm_container_registry.test.admin_username}"