Skip to content

Instantly share code, notes, and snippets.

View nicksuch's full-sized avatar

Nick Such nicksuch

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nicksuch on github.
  • I am nicksuch (https://keybase.io/nicksuch) on keybase.
  • I have a public key ASDEyMYy5-liQuyFpxcsZRfF10hDmVJM0iiUzckd2cmqsAo

To claim this, I am signing this object:

Some Photo Tips

For better smartphone photography and videography

  1. Rule of Thirds - use the grid to help, aim for the corners
  2. Videos are horizontal - don't suffer from Vertical Video Syndrome
  3. Use Binoculars to zoom - great for sporting events, astronomy pics
  4. Group panoramas - run around the side, like this
  5. Hyperlapse - stabilizes your long videos
@nicksuch
nicksuch / FetchWeatherData.java
Last active May 7, 2016 03:13
FetchWeatherData for WeatherSnap
// Stock Code to Fetch Weather
public class FetchWeatherTask extends AsyncTask<String, Void, String[]> {
private final String LOG_TAG = FetchWeatherTask.class.getSimpleName();
String city;
/* The date/time conversion code is going to be moved outside the asynctask later,
* so for convenience we're breaking it out into its own method now.
*/
@nicksuch
nicksuch / UdacityAndroid-JSONHelper.java
Last active September 15, 2018 03:12
Helper methods for JSON parsing for Udacity's Developing Android Apps. Sunshine app, Lesson 2: https://www.udacity.com/course/viewer#!/c-ud853/l-1469948762/e-1630778644/m-1630778645
/* The date/time conversion code is going to be moved outside the asynctask later,
* so for convenience we're breaking it out into its own method now.
*/
private String getReadableDateString(long time){
// Because the API returns a unix timestamp (measured in seconds),
// it must be converted to milliseconds in order to be converted to valid date.
Date date = new Date(time * 1000);
SimpleDateFormat format = new SimpleDateFormat("E, MMM d");
return format.format(date).toString();
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.helloworld.MainActivity" >
package com.example.helloworld;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@Override
@nicksuch
nicksuch / test.html
Created May 23, 2014 19:42
Applying classes to block-level elements in Markdown (when using the Kramdown processor). Shows source (.md) and generated (.html)
<style type="text/css">
ul.posts {
list-style-type: none;
margin: 0 auto;
width: 60%;
}
li {
margin-bottom: 35px;
text-align: center;
#!/usr/bin/ruby
#
# This work is licensed under a Creative Commons Attribution 3.0 Unported License.
# http://creativecommons.org/licenses/by/3.0/
#
# With some slight modifications, this script should create
# a new discount code for each of the 'live' events which are
# owned by the user (who is identified by the user_key value).
#
# See the above license info and Eventbrite API terms for usage limitations.