Skip to content

Instantly share code, notes, and snippets.

@IAmJordanX
IAmJordanX / drawer_layout_preview.xml
Last active September 10, 2015 18:11 — forked from ValCanBuild/drawer_layout_preview.xml
Android preview DrawerLayout NavigationView
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(0);
} else if (position <= 1) { // [-1,1]
//
// NSColor+isLight.h
//
// Created by Reda Lemeden on 7/3/14.
// Copyright (c) 2014 thoughtbot. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSColor (isLight)
package com.jwo.example.sampleform;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
@IAmJordanX
IAmJordanX / PlasticLinearLayout.java
Created September 23, 2012 04:36 — forked from charlieCollins/PlasticLinearLayout.java
Eric Burke's PlasticLinearLayout
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.movl.swipeit.R;
@IAmJordanX
IAmJordanX / AmazonArtwork.m
Created November 19, 2011 03:51 — forked from indragiek/AmazonArtwork.m
Retrieving album artwork from Amazon's Product Services API in Cocoa (using AFNetworking)
static NSString* const kAWSAccessKey = @"__ACCESS__KEY__"; // From AWS Developer portal
static NSString* const kAWSSecretKey = @"__SECRET__KEY__"; // From AWS Developer portal
static NSString* const kAWSAssociateTag = @"examp-99"; // Can be a bogus tag in the format xxxxx-XX (x being a letter and X being a number)
/* NSString category for HMAC and URL string encoding */
@interface NSString (AWSAdditions)
- (NSString*)URLEncodedStringForCharacters:(NSString*)characters;
+ (NSData*)HMACSHA256EncodedDataWithKey:(NSString*)key data:(NSString*)data;
@end