Skip to content

Instantly share code, notes, and snippets.

@kosmologist
kosmologist / export-toby.js
Created February 18, 2019 12:25 — forked from krishpop/export-toby.js
Export Toby
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));
@kosmologist
kosmologist / emulator.bat
Created August 20, 2018 05:08
Start emulator without Android Studio
start "" C:\Users\m.qasim\AppData\Local\Android\Sdk\emulator\emulator.exe @Pixel_XL_API_27
@kosmologist
kosmologist / styles.xml
Created August 2, 2018 09:29
AppCompatAlertDialogStyle
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/ra_red_primary</item>
<item name="android:textColorPrimary">@color/text_grey</item>
<item name="android:background">#ffffff</item>
</style>
@kosmologist
kosmologist / block_dozemode.instructions
Last active July 31, 2018 11:28
How to block Doze mode in Android 6
A foreground service with a partial WakeLock is supposed to block Doze mode (usecases: music-players etc). If the process with the foreground service also has the foreground activity, Doze mode takes over again.
To avoid this start the foreground service in a separate process.
@kosmologist
kosmologist / introrx.md
Created April 3, 2018 07:09 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@kosmologist
kosmologist / OnSwipeTouchListener.java
Created March 16, 2018 12:05
Add touch swipe gesture to any view
/**
* Detects left and right swipes across a view.
*/
public class OnSwipeTouchListener implements OnTouchListener {
private final GestureDetector gestureDetector;
public OnSwipeTouchListener(Context context) {
gestureDetector = new GestureDetector(context, new GestureListener());
}
@kosmologist
kosmologist / interview-engineers.md
Created March 8, 2018 14:16 — forked from somebox/interview-engineers.md
Interviewing Engineers

Note: This is an opinionated guide. While it is most effective for on-site, the same pattern can work with remote candidates.

How To Interview Engineers

Interviewing is hard. It's not easy to find good people, and once you do, it's often difficult to find out what they can do and how they work. A badly-run interview can pass over a great engineer. Conversely, some engineers are good at passing traditional tech interviews, but bring major problems with work habits or team fit.

The first priority of any manager is to hire the best people. Everything else must wait.

Screening

@kosmologist
kosmologist / The Technical Interview Cheat Sheet.md
Created February 26, 2018 07:08 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@kosmologist
kosmologist / gist:a35c7f25805c00220264787c1bcb6ec5
Created February 16, 2018 14:53 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")
@kosmologist
kosmologist / .gitignore
Created February 12, 2018 12:51
Git ignore for android studio
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class