Skip to content

Instantly share code, notes, and snippets.

@cassiozen
cassiozen / pixelbook-dev-setup.md
Last active Apr 13, 2021 — forked from denolfe/pixelbook-linux-setup.md
Notes on setting up Pixelbook for development
View pixelbook-dev-setup.md

Pixelbook Setup

Change your channel

Some of the features mentioned in this document only work on the beta or Dev channel. To change your channel:

  1. chrome://help in a browser window
  2. Click Detailed Build Information
  3. Change Channel
  4. Select Beta (Or Dev, if you're feeling adventurous)
View RegistrationFlow.md

Registration Flow - iOS

A crucial type in the app is the CognitoStore. There's only ever one instance of this type that lives throughout the life-cycle of the app. Everywhere in our app, a dev has access to this one instance through the sharedInstance static stored property on the CognitoStore.

Important to note is the init function on this type. It sets everything up, most imporantly the userPool stored property of type AWSCognitoIdentityUserPool. This in turn will provide access to the AWSCognitoIdentityUser that exists on the AWSCognitoIdentityUserPool. This is done by calling currentUser() on the AWSCognitoIdentityUserPool instance.

We expose the AWSCognitoIdentityUser in the form of a computed property named currentUser.

Here's how accessing this currentUser looks like throughout the app:

@Reyurnible
Reyurnible / Variable.kt
Last active Mar 28, 2018
RxSwift's Variable.swfit convert to Kotlin
View Variable.kt
import io.reactivex.Observable
import io.reactivex.subjects.BehaviorSubject
/**
* Wrapping Rx BehaviorSubject defaultValue object.
* RxSwfit Variable.swfit https://github.com/jspahrsummers/RxSwift/blob/master/RxSwift/SpinLock.swift
*/
class Variable<T> private constructor(defaultValue: T?) {
companion object {
fun <T> create(): Variable<T> = Variable(null)
@rakshakhegde
rakshakhegde / fragment_utility.kt
Last active Nov 11, 2021
Handy Idiom: Pass Arguments to Android Fragment using Kotlin + Anko
View fragment_utility.kt
import android.support.v4.app.Fragment
import org.jetbrains.anko.bundleOf
/**
* Pass arguments to a Fragment without the hassle of
* creating a static newInstance() method for every Fragment.
*
* Declared outside any class to have full access in any
* part of your package.
*
View Variable.java
package rx.playground;
import rx.Observable;
import rx.subjects.BehaviorSubject;
import rx.subjects.SerializedSubject;
public class Variable<T> {
private T value;
private final SerializedSubject<T, T> serializedSubject;
@TheDegree0
TheDegree0 / Unportify-v1.4.3.js
Last active Oct 31, 2019
Unportify helps you export your Google Play Music playlists.
View Unportify-v1.4.3.js
/*
Unportify is a script that exports your Google Play music to text.
Copyright (C) 2016 Arnau Villoslada
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Rcureton
Rcureton / The Technical Interview Cheat Sheet.md
Created Jun 28, 2016 — 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.
View The Technical Interview Cheat Sheet.md

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.
@erichrobinson
erichrobinson / README.md
Last active Nov 19, 2021
SwitchResX Configuration
View README.md

#SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

##Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@macsystems
macsystems / AndroidFontFamiliesByVersion.mk
Last active Aug 15, 2017
Font Families on Android Versions
View AndroidFontFamiliesByVersion.mk
Added in Android Jelly Bean (4.1) - API 16 :
Regular (default):
<item name="android:fontFamily">sans-serif</item>
<item name="android:textStyle">normal</item>
Italic:
<item name="android:fontFamily">sans-serif</item>
@ZacSweers
ZacSweers / RxJava.md
Last active Sep 3, 2018 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda
View RxJava.md

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)