Skip to content

Instantly share code, notes, and snippets.

@jingwings
jingwings / TabParallax.js
Created January 23, 2019 03:27 — forked from andigu/TabParallax.js
A react native component featuring parallax scrolling with tabs
import React, {Component} from "react";
import {Animated, Dimensions, Platform, Text, TouchableOpacity, View} from "react-native";
import {Body, Header, List, ListItem as Item, ScrollableTab, Tab, TabHeading, Tabs, Title} from "native-base";
import LinearGradient from "react-native-linear-gradient";
const {width: SCREEN_WIDTH} = Dimensions.get("window");
const IMAGE_HEIGHT = 250;
const HEADER_HEIGHT = Platform.OS === "ios" ? 64 : 50;
const SCROLL_HEIGHT = IMAGE_HEIGHT - HEADER_HEIGHT;
const THEME_COLOR = "rgba(85,186,255, 1)";
@jingwings
jingwings / 3DAnimation.js
Created January 23, 2019 03:27 — forked from andigu/3DAnimation.js
Advanced demo for panresponder
import React, {Component} from "react";
import {Animated, Dimensions, Easing, PanResponder, StyleSheet, View} from "react-native";
import {Card} from "./Card";
const {width: screenWidth, height: screenHeight} = Dimensions.get("window");
export class Sliding extends Component {
bottomPadding = 10;
data = new Array(20).fill({
name: "John Smith",
@jingwings
jingwings / PersistentCookieStore.java
Created May 15, 2016 08:27 — forked from franmontiel/PersistentCookieStore.java
A persistent CookieStore implementation for use in Android with HTTPUrlConnection or OkHttp 2. -- For a OkHttp 3 persistent CookieJar implementation you can use this library: https://github.com/franmontiel/PersistentCookieJar
/*
* Copyright (c) 2015 Fran Montiel
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jingwings
jingwings / WebViewClient
Created May 15, 2016 02:37 — forked from kibotu/WebViewClient
Android WebView: resource interception and replacement by local resource
mWebView.setWebViewClient(new WebViewClient() {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if (url.contains("creditcard_cvc.jpg")) {
Log.v("WebView", "Replacing [" + url + "] with [R.raw.tmp_replacement]");
ContentResolver contentResolver = getActivity().getContentResolver();
return new WebResourceResponse(contentResolver.getType(Uri.parse(url)), "UTF-8", getResources().openRawResource(R.raw.tmp_replacement));
}
return super.shouldInterceptRequest(view, url);
@jingwings
jingwings / OkHttpStack.java
Created May 12, 2016 01:17 — forked from bryanstern/OkHttpStack.java
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@jingwings
jingwings / fixXcode6OnElCapitan.sh
Created May 8, 2016 05:18 — forked from DaveWoodCom/fixXcode6OnElCapitan.sh
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
@jingwings
jingwings / iterm2-solarized.md
Created January 29, 2016 03:39 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@jingwings
jingwings / gitignore-android-studio-list
Created January 5, 2016 05:27 — forked from vtanathip/gitignore-android-studio-list
Git Ignore files list that should use in Android Studio Projects
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@jingwings
jingwings / curl.md
Created December 25, 2015 09:59 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@jingwings
jingwings / Api.java
Created November 26, 2015 10:35 — forked from snadjafi/Api.java
android retrofit setup example
public final class Api {
//region Variables
private static final String API_HOST = Application.string(R.string.api_server);
private static final Object sLockObject = new Object();
private static Service sService = null;
static final int DISK_CACHE_SIZE = 50 * 1024 * 1024; // 50MB
//endregion