Skip to content

Instantly share code, notes, and snippets.

View okmanideep's full-sized avatar

Manideep Polireddi okmanideep

View GitHub Profile
@okmanideep
okmanideep / beginhtml.html
Last active August 29, 2015 14:05
HTML page template
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<title>title</title>
</head>
<body>
content
</body>
@okmanideep
okmanideep / AndroidGoToSettings.java
Created November 17, 2015 21:22
Takes the user to your app's info page in settings
private void goToSettings() {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.parse("package:" + getPackageName());
intent.setData(uri);
startActivity(intent);
}
@okmanideep
okmanideep / jekyll_pygments_github.css
Created November 17, 2015 21:44
Syntax highlighting scheme for your code and pre blocks in jekyll which almost matches that of github
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #a71d5d;} /* Keyword */
.highlight .cm { color: #969896 } /* Comment.Multiline */
.highlight .cp { color: #cc0000;} /* Comment.Preproc */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
@okmanideep
okmanideep / jekyll_pygments_line_numbers.css
Last active November 24, 2015 07:14
Adds line numbers to your pre blocks using css counters (enable lineanchors for pygments)
pre {
counter-reset: line-numbering;
border: solid 1px #d9d9d9;
border-radius: 0;
background: #fff;
padding: 0;
line-height: 23px;
margin-bottom: 30px;
white-space: pre;
overflow-x: auto;
@okmanideep
okmanideep / BetterRecyclerView.java
Last active March 3, 2022 17:18
A RecyclerView that intercepts the scroll only if the user is scrolling in that direction
public class BetterRecyclerView extends RecyclerView{
private static final int INVALID_POINTER = -1;
private int mScrollPointerId = INVALID_POINTER;
private int mInitialTouchX, mInitialTouchY;
private int mTouchSlop;
public BetterRecyclerView(Context context) {
this(context, null);
}
public BetterRecyclerView(Context context, @Nullable AttributeSet attrs) {
@okmanideep
okmanideep / Redux.kt
Created July 28, 2018 16:53
Kotlin Redux
class Store<S, A>(initialState: S, private val reducer: (S, A) -> S) {
private val TAG = "Redux"
private val stateProcessor: BehaviorProcessor<S> = BehaviorProcessor.create()
private val eventProcessor: PublishProcessor<Event<S, A>> = PublishProcessor.create()
init {
stateProcessor.onNext(initialState)
}
@okmanideep
okmanideep / markdown.css
Created July 30, 2020 09:17
Markdown CSS (tweaked from github's theme)
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAA
@okmanideep
okmanideep / EventQueue.kt
Last active October 2, 2024 04:19
Event abstraction for Jetpack Compose
import androidx.compose.runtime.*
import kotlinx.coroutines.CoroutineScope
@Stable
internal class Event<T>(val value: T)
class MutableEventQueue<T>
internal constructor(): EventQueue<T>() {
private val events = mutableListOf<Event<T>>()
private val nextEventAsState = mutableStateOf<Event<T>?>(null)
@okmanideep
okmanideep / jira-cli.json
Last active July 2, 2022 10:33
Scoop app manifest for ankitpokhrel/jira-cli
{
"description": "CLI for Atlassian Jira",
"bin": "bin\\jira.exe",
"architecture": {
"64bit": {
"url": "https://github.com/ankitpokhrel/jira-cli/releases/download/v1.0.0-beta.2/jira_1.0.0-beta.2_windows_amd64.zip",
"hash": "c15c9c1b6f8bbecc19ef953874373ee0407e51689aadb820cddaf0a3cfa32359"
}
},
"license": {
@okmanideep
okmanideep / actionlist.vim
Created July 21, 2023 09:46 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>