Skip to content

Instantly share code, notes, and snippets.

View rakshakhegde's full-sized avatar

Rakshak R.Hegde rakshakhegde

View GitHub Profile
fun lsxUsage() {
val list = listOf(2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
println(list[1..3]) // [3, 5, 7]
println(list[1 til 3]) // [3, 5]
println(list[4..1]) // [11, 7, 5, 3]
println(list[4 til 1]) // [11, 7, 5]
println(list[2..-1]) // [5, 7, 11, 13, 17, 19, 23, 29]
println(list[2 til -1]) // [5, 7, 11, 13, 17, 19, 23]
println(list[3..0 by 1]) // [7, 5, 3, 2]
@alphamu
alphamu / Android Privacy Policy Template
Created February 9, 2017 03:17
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@dKvale
dKvale / EC2_web_server.md
Last active February 22, 2024 08:01
Quick setup for hosting a static website on Amazon EC2 server.

Github pages -> Amazon EC2 server

0) Login to the EC2 Amazon Console

https://console.aws.amazon.com/console/home

1) In the EC2's Security group section add an inbound rule to open ports 80 and 443

Type: HTTP, Protocol: TCP, Port: 80, Source: 0.0.0.0/0
Type: HTTPS, Protocol: TCP, Port: 443, Source: 0.0.0.0/0

2) Copy the Public DNS for your EC2 instance

@jaydp17
jaydp17 / build.gradle
Created October 30, 2015 03:31
Kotlin and dataBinding
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.mvptestkotlin"
@curioustechizen
curioustechizen / UseApiKey.java
Created April 6, 2015 07:37
Android: Loading API Keys and other secrets from properties file using gradle
String apiKey = BuildConfig.API_KEY
@ogaclejapan
ogaclejapan / MainActivity.java
Last active September 27, 2016 07:43
Sample of SmartTabLayout Issue #2
package com.ogaclejapan.myapplication;
import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItem;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItems;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
@tylerchesley
tylerchesley / TintableImageView.java
Created March 17, 2015 16:36
Backwards compatible TintableImageView
package com.example.widgets;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.example.R;
@jaredrummler
jaredrummler / MenuTint.java
Last active April 13, 2022 03:58
Helper class to set the color and transparency for menu icons in an ActionBar or Toolbar.
/*
* Copyright (C) 2015. Jared Rummler <jared.rummler@gmail.com>
*
* 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
@devinmancuso
devinmancuso / chromemobiletest.py
Last active May 26, 2023 11:00
Example Python Chrome Mobile Emulation Automated Unit Testing Using Selenium 2 WebDriver ChromeDriver
# Import unittest module for creating unit tests
import unittest
# Import time module to implement
import time
# Import the Selenium 2 module (aka "webdriver")
from selenium import webdriver
# For automating data input
@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;