Skip to content

Instantly share code, notes, and snippets.

View davinctor's full-sized avatar
🎯
Focusing

Viktor Ponomarenko davinctor

🎯
Focusing
View GitHub Profile
@baderj
baderj / twitch_past_broadcast_downloader.py
Last active March 5, 2023 21:43
script to download past broadcasts from twitch.tv
import requests
import sys
import json
import re
import os
import string
import argparse
BASE_URL = 'https://api.twitch.tv'
@anry200
anry200 / ScalableVideoView.java
Created January 16, 2014 13:40
Android : How to stretch video to use whole area of VideoView (code snippets)
import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;
public class ScalableVideoView extends VideoView {
private int mVideoWidth;
private int mVideoHeight;
private DisplayMode displayMode = DisplayMode.ORIGINAL;
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@gsysko
gsysko / MainActivity
Last active May 15, 2017 09:32
Setting imeActionId with a predefined ID resource creates an error.
package com.me.keyboard.test;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
@laaptu
laaptu / CheckingTheme.java
Last active September 13, 2019 15:56
How to get theme id
TypedValue outValue = new TypedValue();
getTheme().resolveAttribute(R.attr.themeName, outValue, true);
if(outValue.equals(getString(R.string.custom_title_theme))){
//you have applied this theme else not
}
//http://stackoverflow.com/questions/7267852/android-how-to-obtain-the-resource-id-of-the-current-theme
@maxim
maxim / task.yml
Created June 12, 2014 11:09
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* 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
@borlaym
borlaym / animals.json
Created December 15, 2014 13:38
Array of animal names
[
"Aardvark",
"Albatross",
"Alligator",
"Alpaca",
"Ant",
"Anteater",
"Antelope",
"Ape",
"Armadillo",
@NarendraDodiya
NarendraDodiya / StepValueSeekbar.java
Last active April 2, 2021 22:10
seekbar with step value and min max or range values
package tyrantgit.sample;
import android.view.View;
import android.widget.SeekBar;
/**
* Created by narendra on 30/9/15.
*/
public class StepValueSeekbar {
@ph0b
ph0b / app_build.gradle
Last active November 20, 2019 09:21
config example on Multiple APK support and mixing gradle-stable and gradle-experimental plugin, for NDK-enabled Android projects. To support AS 2.0 debug, just add lib/build/intermediates/binaries/release/obj/[abi] to Symbol directories
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.example.yourapp"
minSdkVersion 16
targetSdkVersion 23