Skip to content

Instantly share code, notes, and snippets.

View corsc's full-sized avatar
🏠
Working from home

Corey Scott corsc

🏠
Working from home
View GitHub Profile
@corsc
corsc / clean.sh
Created September 14, 2014 04:16
Sample Golang cleanup & check script
#!/bin/bash
# ======================
# Download the tools
# ======================
go get code.google.com/p/go.tools/cmd/goimports
go get github.com/golang/lint/golint
# ======================
# Clean the Code
@corsc
corsc / Define the type
Created September 17, 2014 15:00
Example of Enums in Go
// Color is a custom type (enum) to improve my code readibility
type Color int64
@corsc
corsc / after.go
Last active August 29, 2015 14:10
Golang Revenge of Capt Obvious
amount := 12.34
ID := int64(3)
@corsc
corsc / activity_main.xml
Last active December 11, 2015 08:59
Sage42.org Blog Entry - Example V1
<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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/title_v1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@corsc
corsc / activity_main.xml
Created January 20, 2013 09:07
Sage42.org Blog Entry - Example V2
<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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/title_v2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@corsc
corsc / activity_main.xml
Created January 20, 2013 09:44
Sage42.org Blog Entry - Example V3
<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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/title_v3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@corsc
corsc / so_answer
Created July 13, 2013 03:04
A Stackoverflow answer
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
@corsc
corsc / standard_structure
Created August 12, 2013 03:08
Example for blog post
values/
strings.xml
styles.xml
@corsc
corsc / revised_structure
Created August 12, 2013 03:09
Example for blog entry
values/
strings.xml (standard strings used all over the place like "OK" or "YES"
strings_user.xml (strings for the user module)
strings_registration.xml (strings for the registration module)
styles.xml (standard styles used everywhere, e.g. base styles, templates or menu/tab styles)
styles_user.xml (styles only used in the user module)
styles_registration.xml (styles only used in the registration module)
@corsc
corsc / multiple files
Last active December 20, 2015 22:49
Example for blog entry
strings_user.xml
<resources>
<string name="user_name">Name</string>
<string name="user_password">Password</string>
<string name="user_phone">Phone</string>
</resources>
strings_registration.xml