Skip to content

Instantly share code, notes, and snippets.

@yyaammaa
yyaammaa / gist:7314571
Last active December 27, 2015 10:49
Android 4.3 (API level 18) でAction Barの影が出ない

Android 4.3 (API level 18) でAction Barの影が出ない

問題

Issue 58280: ActionBar does not display windowContentOverlay drawable
android:windowContentOverlay がAndroid 4.3 (API level 18) で無視されるため、Action Barの影をカスタムで指定できない

styles.xml

<resources>
    <style name="AppTheme" parent="android:Theme.Light">
 
@hagix9
hagix9 / gist:7287649
Last active February 23, 2017 20:30
Dockerでプライベートリポジトリを使う
#プライベートリポジトリ用コンテナを起動
docker run -d -p 5000:5000 samalba/docker-registry
#実験のために適当なコンテナを起動
docker run -i -t -d --name cent01 centos /bin/bash
#起動したコンテナをコミットしてタグ付け
docker commit cent01 test1/centos
docker tag test1/centos 192.168.10.60:5000/centos_test
@aprock
aprock / RoundedTransformation.java
Created August 12, 2013 18:08
Rounded Corner Image Transformation for square's Picasso
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
// enables hardware accelerated rounded corners
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
@tonyarnold
tonyarnold / ReactiveCocoa.podspec
Last active December 20, 2015 01:59
ReactiveCocoa 2.0 needs to include it's own version of libextobjc specifically. Until ReactiveCocoa 2.0 is properly released, you'll need to specify `pod "ReactiveCocoa", :head` in your project's Podfile.
Pod::Spec.new do |s|
s.name = "ReactiveCocoa"
s.version = "2.0-development"
s.summary = "A framework for composing and transforming sequences of values."
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source"
s.author = { "Josh Abernathy" => "[email protected]" }
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :branch => "fishhook-off-device" }
s.license = 'Simplified BSD License'
s.description = "ReactiveCocoa offers:\n" \
"1. The ability to compose operations on future data.\n" \
@cyrilmottier
cyrilmottier / _app_avelibRelease_res_values_config.xml
Last active November 20, 2020 11:27
Using the new Gradle-based Android build system: an example
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="config_app_name">AVélib</string>
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string>
<string name="config_com.google.android.maps.v2.api_key">XXX</string>
</resources>
@azu
azu / xcode-gcov.sh
Created June 8, 2013 14:14
xctool test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YESでビルドした、gcovのディレクトリを取得する
#!/bin/bash
trim()
{
trimmed=$1
trimmed=${trimmed%% }
trimmed=${trimmed## }
echo $trimmed
}
@pthariensflame
pthariensflame / IndexedCont.md
Last active April 3, 2022 00:30
An introduction to the indexed continuation monad in Haskell, Scala, and C#.

The Indexed Continuation Monad in Haskell, Scala, and C#

The indexed state monad is not the only indexed monad out there; it's not even the only useful one. In this tutorial, we will explore another indexed monad, this time one that encapsulates the full power of delimited continuations: the indexed continuation monad.

Motivation

The relationship between the indexed and regular state monads holds true as well for the indexed and regular continuation monads, but while the indexed state monad allows us to keep a state while changing its type in a type-safe way, the indexed continuation monad allows us to manipulate delimited continuations while the return type of the continuation block changes arbitrarily. This, unlike the regular continuation monad, allows us the full power of delimited continuations in a dynamic language like Scheme while still remaining completely statically typed.

@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@ficusk
ficusk / GsonRequest.java
Last active January 6, 2025 22:43
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@mpospese
mpospese / CGRectIntegralScaled.m
Created February 28, 2013 03:34
Pixel aligns rectangles, taking the device's screen scale into account.
CGRect CGRectIntegralScaledEx(CGRect rect, CGFloat scale)
{
return CGRectMake(floorf(rect.origin.x * scale) / scale, floorf(rect.origin.y * scale) / scale, ceilf(rect.size.width * scale) / scale, ceilf(rect.size.height * scale) / scale);
}
CGRect CGRectIntegralScaled(CGRect rect)
{
return CGRectIntegralScaledEx(rect, [[UIScreen mainScreen] scale]);
}