Skip to content

Instantly share code, notes, and snippets.

private boolean insertImage(File image) throws IOException {
ContentValues values;
values = new ContentValues();
values.put(MediaStore.Images.ImageColumns.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + "test");
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, Long.toString(System.currentTimeMillis()));
values.put(MediaStore.Images.ImageColumns.IS_PENDING, true);
Uri uri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
if (uri == null) {
return false;
}
@ttodua
ttodua / PEiD "userdb.txt" full
Last active March 14, 2023 07:13
PEiD "userdb.txt" full (3 compilaction merged)
; 3 DBs together:
; https://handlers.sans.org/jclausing/userdb.txt
; https://web.archive.org/web/20160611182612/https://reverse-engineering-scripts.googlecode.com/files/UserDB.TXT
; https://web.archive.org/web/20140924084024/http://research.pandasecurity.com/blogs/images/userdb.txt
; current page: https://gist.github.com/ttodua/a7876b9aed1e93890b3c7aaebddc9f4e
[!EP (ExE Pack) V1.0 -> Elite Coding Group]
signature = 60 68 ?? ?? ?? ?? B8 ?? ?? ?? ?? FF 10
ep_only = true
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active March 26, 2022 10:03
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* 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
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@jaburns
jaburns / gfm-render.sh
Last active August 27, 2023 16:02
Bash script to render github flavoured markdown to HTML
#!/usr/bin/env bash
data="$(
cat "$1" \
| sed 's/"/\\"/g' \
| sed ':a;N;$!ba;s/\n/\\n/g' \
)"
if [[ -z "$2" ]]; then
context=''
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* 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
@lucasr
lucasr / AnimatedLinearLayout.java
Last active December 16, 2022 19:58
Animated LinearLayout
package com.example.android_transition_samples.app;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
@chrisbanes
chrisbanes / ForegroundLinearLayout.java
Created February 19, 2014 13:16
ForegroundLinearLayout
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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
@romannurik
romannurik / DrawInsetsFrameLayout.java
Created February 10, 2014 16:28
DrawInsetsFrameLayout — adding additional background protection for system UI chrome when using KitKat’s translucent decor flags.
/*
* Copyright 2014 Google Inc.
*
* 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