Skip to content

Instantly share code, notes, and snippets.

View qwertyfinger's full-sized avatar

Andrii Chubko qwertyfinger

View GitHub Profile
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@pandulapeter
pandulapeter / SharedPrefManager.kt
Last active September 19, 2018 01:22
SharedPrefManager
class SharedPrefManager(context: Context) {
private val preferences = PreferenceManager.getDefaultSharedPreferences(context.applicationContext)
var booleanField by PreferenceFieldDelegate.Boolean("boolean_field")
var intField by PreferenceFieldDelegate.Int("int_field")
var stringField by PreferenceFieldDelegate.String("string_field")
private sealed class PreferenceFieldDelegate<T>(protected val key: kotlin.String) : ReadWriteProperty<SharedPrefManager, T> {
class Boolean(key: kotlin.String) : PreferenceFieldDelegate<kotlin.Boolean>(key) {
@pavlospt
pavlospt / CandidatesAdapter.java
Created October 2, 2016 16:40
OnViewRecycled Implementation
@Override
public void onViewRecycled(Candidates holder) {
if(holder != null) {
holder.binding.getCandidateVM().removePropertyChangedCallback();
holder.binding.setCandidateVM(null);
holder.binding.setHighlightTerm(null);
holder.binding.setShowJobTitle(false);
holder.binding.setShowStage(false);
holder.binding.executePendingBindings();
Glide.clear(holder.binding.candidateBrowserAvatar);
@PurpleBooth
PurpleBooth / README-Template.md
Last active March 24, 2024 02:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@staltz
staltz / introrx.md
Last active March 29, 2024 06:13
The introduction to Reactive Programming you've been missing