Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@salcode
salcode / .gitignore
Last active April 3, 2024 18:37
.gitignore file for a general web project - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# https://salferrarello.com/starter-gitignore-file/
# ver 20221125
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore
# to download this file
#
@MarsVard
MarsVard / README
Last active November 3, 2022 19:19
android drawable to imitate google cards.
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"
@imminent
imminent / MyApplication.java
Created November 22, 2013 16:09
Example of setup that registers/unregisters non-singleton POJOs with an Event Bus.
package com.example;
import android.annotation.TargetApi;
import android.app.Application;
import android.app.ActivityLifecycleCallbacks;
import com.squareup.otto.Bus;
import javax.inject.Inject;
import javax.inject.Provider;
import dagger.ObjectGraph;
import java.util.Map;
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@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.
*/
@daichan4649
daichan4649 / CheckableLayout.java
Created March 26, 2013 13:32
Checkable ListView (for Android)
package daichan4649.test;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Checkable;
import android.widget.LinearLayout;
public class CheckableLayout extends LinearLayout implements Checkable {
@fi-tomek-augustyn
fi-tomek-augustyn / gist:4706155
Last active December 12, 2015 03:19
Gesture detection: Implementing Swipe, Pinch/Stretch and Rotate gestures
// Define constant values
var MIN_ROTATION = 20;
var MIN_SCALE = .3;
var MIN_SWIPE_DISTANCE = 50;
// Define variables
var rotation, scale, recognized, translationX, translationY;
/**
* Reset gesture
@Nilzor
Nilzor / GridLayoutSquares.xml
Created January 25, 2013 10:26
Grid Layout 2x2 attempt equal sized, screen-filling attempt
<?xml version="1.0" encoding="utf-8"?>
<!-- REMEMBER TO UPDATE BOTH LANDSCAPE AND PORTRAIT FILES -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:grid="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Setting up GridLayout support library in IntelliJ: http://stackoverflow.com/questions/12468606/intellij-and-android-support-v7-widget-gridlayout -->
<android.support.v7.widget.GridLayout
android:layout_width="match_parent"
import android.accounts.Account;
import android.accounts.AccountManager;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Build;
import android.preference.PreferenceManager;
import com.google.android.gms.auth.GoogleAuthUtil;
@tian2992
tian2992 / remotedisplay.py
Created January 2, 2013 00:06
An Android monkeyrunner based remote control. Thanks to Jython and Swing. Should be executed from the monkeyrunner REPL
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
device = MonkeyRunner.waitForConnection()
from javax.swing import JButton, JFrame, JPanel, ImageIcon
frame = JFrame('Android Display!',
defaultCloseOperation = JFrame.EXIT_ON_CLOSE,
size = (960, 540)
)