Skip to content

Instantly share code, notes, and snippets.

@ganadist
ganadist / check_binder_leak
Last active August 29, 2015 14:14
show BinderProxy reference information when run "dumpsys meminfo -a"
#!/usr/bin/env python2
import sys, os
import collections
def parse_meminfo(filename):
def parse(filename):
lines = []
for line in open(filename):
line = line[:-1]
@brandonb927
brandonb927 / dropbox
Last active February 22, 2022 01:25
Dropbox init.d script for Ubuntu 14.04 Server LTS - Dropbox has (recently) changed the CLI daemon from `dropbox` to `dropboxd`.
#!/bin/sh
# Usernames who will be using the Dropbox service
DROPBOX_USERS="username"
DAEMON=.dropbox-dist/dropboxd
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
@soheilhy
soheilhy / nginxproxy.md
Last active July 5, 2025 15:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@MostafaGazar
MostafaGazar / SvgMaskedImageView.java
Last active August 21, 2024 12:37
Based on https://github.com/MostafaGazar/CustomShapeImageView, Custom shape ImageView using PorterDuffXfermode and SVGs as masks
/*
* Copyright 2014 Mostafa Gazar
*
* 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
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active November 8, 2025 10:46
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
License: https://opensource.org/license/bsd-3-clause
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps
@importre
importre / install_apk.bat
Last active December 30, 2015 02:59
apk installer for devices connected to your machine with GUI
python %~dp0\\install_apk.py %1
@rxaviers
rxaviers / gist:7360908
Last active November 18, 2025 03:19
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@JakeWharton
JakeWharton / dex.sh
Last active March 25, 2024 13:54
`classes.dex` method count helpers. Requires smali/baksmali from https://code.google.com/p/smali/ and dexdump from the build-tools in the Android SDK be on your PATH.
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
@benelog
benelog / Volley.md
Last active October 20, 2023 02:05
Volley ์„ค๋ช…

์•ˆ๋“œ๋กœ์ด๋“œ ๊ฐœ๋ฐœ์—์„œ ๋งŽ์€ ๋น„์ค‘์„ ์ฐจ์ง€ํ•˜๋Š” UIํŒจํ„ด์€ ListView์—์„œ ์—ฌ๋Ÿฌ ์ด๋ฏธ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” Activity์ž…๋‹ˆ๋‹ค. ์ „ํ˜•์ ์ธ ํ๋ฆ„์„ ์ •๋ฆฌํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

โ€‹1. ๋ชฉ๋ก์กฐํšŒ APIํ˜ธ์ถœ

โ€‹2. API๋ฅผ ํŒŒ์‹ฑํ•˜๊ณ  ListView์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ ์คŒ.

โ€‹3. ๊ฐ ์•„์ดํ…œ๋งˆ๋‹ค์˜ ์ด๋ฏธ์ง€ ์ฃผ์†Œ๋กœ ๋‹ค์‹œ ์„œ๋ฒ„๋ฅผ ํ˜ธ์ถœ

โ€‹4. ์ด๋ฏธ์ง€๋ฅผ ๋””์ฝ”๋”ฉํ•˜๊ณ  ImageView์—์„œ ๋ณด์—ฌ์คŒ.

@TomTasche
TomTasche / AndroidManifest.xml
Last active May 11, 2023 20:00
OAuth flow using the AccountManager on Android
<!-- ... -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- ... -->