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
import Link from 'next/link' | |
import dateFormat from 'dateformat' | |
import Markdown from 'react-markdown' | |
class Post extends React.Component { | |
render() { | |
const { | |
title, | |
content, | |
publish_date, |
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
componentDidMount() { | |
const cachedAirtableNotes = localStorage.getItem('_cachedAirtableNotes') | |
if (cachedAirtableNotes) { | |
// Local data exists, now let's see if it has "expired" | |
// parse data | |
const parsedAirtableNotes = JSON.parse(cachedAirtableNotes) | |
// Check current time against timestamp |
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
// | |
// Media Queries | |
// —·—·—·—·—·—·—·—·—·—·—·— | |
// NOTE: a 93.75% reduction in full resolution width was | |
// made for the desktop breakpoints to accommodate | |
// browser chrome and small vertical spaces in | |
// approximating a full-screen browser on that | |
// specific resolution. |
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
@function pem($target, $context: $em_base) | |
@return #{$target / $context}em | |
@function prem($target, $context: $em_base) | |
@return #{$target / $context}rem | |
@mixin setFont($face: "regular", $size: 0, $line-height: 0) | |
$family: "Helvetica Neue", Arial, sans-serif | |
$style: normal | |
$weight: normal |
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
NSString * const EverydayWeatherUnitTempPrefKey = @"EverydayWeatherUnitTempPrefKey"; | |
NSString * const EverydayWeatherOptShowHelperTaps = @"EverydayWeatherOptShowHelperTaps"; | |
@implementation EverydayWeatherAppDelegate | |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// Registers applications default settings | |
NSArray *dictObjects = [NSArray arrayWithObjects:[NSNumber numberWithInt:1], [NSNumber numberWithBool:YES], nil]; |
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
// Grab User Settings for units | |
unitTemp = [[NSUserDefaults standardUserDefaults] integerForKey:@"EverydayWeatherUnitTempPrefKey"]; |
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
// Round temperature values to whole integers | |
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; | |
[numberFormatter setMaximumFractionDigits:0]; | |
[numberFormatter setRoundingMode: NSNumberFormatterRoundUp]; | |
// Get the current temp from Current Forecast JSON | |
// Default is °F, convert to °C if User Settings is set to Celcius (0) | |
if (unitTemp == 1) { | |
currentTemp = [numberFormatter stringFromNumber:[currently valueForKeyPath:@"temperature"]]; | |
} |
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
// "alerts" is the array that contains the weather alerts | |
int weatherAlertsCount = alerts.count; | |
NSString *weatherAlertLabelMain = @""; | |
NSString *weatherAlertLabelMinor = @""; | |
if (weatherAlertsCount > 1) { | |
weatherAlertLabelMain = [NSString stringWithFormat:@"%d Weather Alerts", weatherAlertsCount]; | |
} | |
else { |
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
- (void)displayCurrentDate | |
{ | |
// This grabs the current date and initializes it to | |
// the variable "now" | |
NSDate *now = [[NSDate alloc] init]; | |
// This initializes the class that turns NSDate objects | |
// into readable text strings | |
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; | |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Get screen size (e.g. iPhone 4 or 5) | |
CGRect screenSize = [[UIScreen mainScreen] bounds]; | |
// Sets dimensions for the root view and scroll view | |
[self.view setFrame:CGRectMake(0.0, 0.0, screenSize.size.width, screenSize.size.height)]; | |
[scrollView setFrame:CGRectMake(0.0, 0.0, screenSize.size.width, screenSize.size.height)]; |
NewerOlder