Skip to content

Instantly share code, notes, and snippets.

🙏
:)

Prem Nirmal premnirmal

🙏
:)
Block or report user

Report or block premnirmal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rkjha
rkjha / nginx-passenger-ssl.conf
Last active Mar 26, 2019
Nginx/Passenger config when using SSL with a Ruby/Rails Application.
View nginx-passenger-ssl.conf
# for redirecting hhtp traffic to https version of the site
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
# for redirecting to non-www version of the site
server {
listen 80;
@pyricau
pyricau / LeakSlackUploadService.java
Created May 9, 2015
Sending Leak Traces to a Slack Channel (and HipChat, see the comments)
View LeakSlackUploadService.java
import android.util.Log;
import com.squareup.leakcanary.AnalysisResult;
import com.squareup.leakcanary.DisplayLeakService;
import com.squareup.leakcanary.HeapDump;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.mime.TypedFile;
@bparmentier
bparmentier / stockticker_logcat
Last active Aug 29, 2015
StockTicker logcat
View stockticker_logcat
I/Timeline( 4809): Timeline: Activity_launch_request id:com.github.premnirmal.tickerwidget time:352854051
I/ActivityManager(14315): START u0 {cmp=com.github.premnirmal.tickerwidget/com.github.premnirmal.ticker.ui.TickerSelectorActivity} from pid 4809
I/ActivityManager(14315): Displayed com.github.premnirmal.tickerwidget/com.github.premnirmal.ticker.ui.TickerSelectorActivity: +186ms
I/Timeline( 4809): Timeline: Activity_idle id: android.os.BinderProxy@420f4fe8 time:352854305
I/Timeline(14315): Timeline: Activity_windows_visible id: ActivityRecord{42281788 u0 com.github.premnirmal.tickerwidget/com.github.premnirmal.ticker.ui.TickerSelectorActivity t68} time:352854594
E/AndroidRuntime( 4809): FATAL EXCEPTION: main
E/AndroidRuntime( 4809): Process: com.github.premnirmal.tickerwidget, PID: 4809
E/AndroidRuntime( 4809): java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
E/AndroidRuntime( 4809): at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:50)
View CollapsingTitleLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
@markushi
markushi / MyActivity.java
Last active Oct 25, 2017
Reveal Color View Demo
View MyActivity.java
package at.markushi.reveal;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Point;
import android.os.Bundle;
import android.view.View;
import at.markushi.ui.RevealColorView;
@deepankarb
deepankarb / svg-to-android.sh
Last active Jul 14, 2018
A script to generate android assets from a SVG file. Requires inkscape to resize and convert.
View svg-to-android.sh
#!/bin/bash
if [[ -z "$1" ]];
then
echo "No SVG file specified. Exiting."
exit -1
fi
ispng=$(file $1)
echo $ispng | grep -q SVG
@stkent
stkent / android_studio_shortcuts.md
Last active Sep 27, 2019
Android Studio Shortcuts (Mac)
View android_studio_shortcuts.md

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

View CircularProgressDrawable.java
public class CircularProgressDrawable extends Drawable
implements Animatable {
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator();
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator();
private static final int ANGLE_ANIMATOR_DURATION = 2000;
private static final int SWEEP_ANIMATOR_DURATION = 600;
private static final int MIN_SWEEP_ANGLE = 30;
private final RectF fBounds = new RectF();
@ronshapiro
ronshapiro / maven-deploy.md
Last active Jun 1, 2016
Getting a jar on Maven Central: An Epic
View maven-deploy.md
@f2prateek
f2prateek / ActivitySubscriptionManager.java
Last active Oct 23, 2017
Managing Subscriptions in Android with RxJava
View ActivitySubscriptionManager.java
/*
* Copyright 2014 Prateek Srivastava
*
* 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
You can’t perform that action at this time.