Skip to content

Instantly share code, notes, and snippets.

View rozag's full-sized avatar

Alexey Mileev rozag

  • Earth
View GitHub Profile
@AndrewRadev
AndrewRadev / LICENSE
Last active March 20, 2024 14:25
Execute a vim motion on the "next" text object
MIT License
Copyright (c) 2017 Andrew Radev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@bregenspan
bregenspan / gist:5637609
Created May 23, 2013 16:59
Android Studio Logcat Filter to exclude spammy messages
^((?!wpa_supplicant|NetStatUtil).*)$
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active April 12, 2025 21:46
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
@tonyseek
tonyseek / formula.py
Last active June 28, 2022 09:13
render latex formula with matplotlib and pillow.
try:
from StringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import matplotlib.pyplot as plt
def render_latex(formula, fontsize=12, dpi=300, format_='svg'):
"""Renders LaTeX formula into image."""
@olejon
olejon / Install Spotify 0.9 on Fedora 64-bit
Last active December 1, 2024 12:49
Install Spotify 0.9 on Fedora 64-bit
# NOTES
# Spotify 0.9 vs 1.0 is stable, uses less resources overall and works well with Spotify Connect, SpotCommander, Local Files etc
# Tested and works on Fedora 29 64-bit with GNOME, but should work on previous versions as well
# The sources of the Dropbox files, which are hosted by me and the latest and greatest available, are listed above each one
# No system files will be overwritten by these or used by other programs since they depend on the later Fedora versions
# Make sure you copy the whole lines into Terminal
# Each command is on one line and might be long
# START GUIDE
@neworld
neworld / howto.md
Last active July 10, 2024 11:24
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
/**
* * New version: 30/May/2017
* * Made it more kotlin-like with same functionality ^^
*
* based on: https://gist.github.com/RomansBermans/6f3836188427fbd3b1efcf7e6418f06d
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
@theyann
theyann / KeyStoreCompat.java
Created April 15, 2017 20:38
KeyStoreCompat is a simple class that takes care of dealing with KeyStore and using the AndroidKeyStore when it can, or another type if it can't. You're welcome.
package YOUR_PACKAGE;
import android.content.Context;
import android.os.Build;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.Certificate;
@timzhang926
timzhang926 / how-to-generate-and-use-private-keys-with-openssl-tool.md How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use