Skip to content

Instantly share code, notes, and snippets.

@codinronan
codinronan / components.txt
Last active February 12, 2019 05:53
React components
https://github.com/tajo/react-range - only 3.2kb minzipped, smallest I've ever seen, fully stylable and fully accessible
https://github.com/tajo/react-movable - better than draggable or dragula or dropzone, all of which are huge - this is only 3.8kb minzipped
@codinronan
codinronan / hooks.txt
Last active February 12, 2019 05:45
React Hooks
https://usehooks.com/useDarkMode/
--> https://github.com/donavon/use-dark-mode
https://usehooks.com/useLocalStorage/
https://usehooks.com/useMedia/
https://github.com/donavon/use-persisted-state
https://github.com/gragland/usehooks/tree/master/src/pages
https://www.reddit.com/r/reactjs/comments/apf7bz/rreactjs_hooks_contest_winners/
@codinronan
codinronan / PluginLinks.txt
Last active February 12, 2019 05:27
Cordova
@codinronan
codinronan / bp.txt
Created January 17, 2019 08:02
React best practices
https://www.reddit.com/r/reactjs/comments/agpo04/react_best_practices/
@codinronan
codinronan / events.service.ts
Last active June 9, 2018 00:20
Decorator for Ionic Storage
import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
// We use a ReplaySubject instead of a Subject or BehaviorSubject because we want to ensure 2 things:
// 1. That new subscribers receive any current values
// 2. That if the subject has never been invoked, no value is passed when a subscriber is wired up.
// Subject does not provide replay behavior (providing the current value), and BehaviorSubject
// requires an initial value, which may not be appropriate to the event.
// Therefore ReplaySubject, with a 1-element window, is the correct choice.

Keybase proof

I hereby claim:

  • I am codinronan on github.
  • I am eapat (https://keybase.io/eapat) on keybase.
  • I have a public key ASDMyOAjW_-tZQviT7t5--AA8N_z8NcWc-Bk1a4-GiOE4Ao

To claim this, I am signing this object:

@codinronan
codinronan / timestamp_version_bump.js
Created February 18, 2018 00:22
Apache Cordova build hook to auto bump iOS CFBundleVersion and Android versionCode
#!/usr/bin/env node
var fs = require("fs"),
path = require("path");
var rootdir = process.argv[2];
if (rootdir) {
module.exports = function(context) {
@codinronan
codinronan / gist:24e93bb7a8717e13279a43882ab5c4f2
Last active February 19, 2018 21:12
cordova-plugin-braintree-gradle-fix.js
#!/usr/bin/env node
// Define hook in your config.xml inside the android platform node:
// <platform name="android">
// <hook src="scripts/gradle-fix.js" type="before_prepare" />
// <hook src="scripts/gradle-fix.js" type="after_prepare" />
// </platform>
// The purpose of this script is to resolve the android.support version conflicts in cordova plugins
@codinronan
codinronan / countries.json
Created February 2, 2018 10:04 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@codinronan
codinronan / us-states.js
Last active January 24, 2018 19:47
JSON apping of US states and abbreviations
var usStates = [
{ name: 'ALABAMA', abbreviation: 'AL'},
{ name: 'ALASKA', abbreviation: 'AK'},
{ name: 'AMERICAN SAMOA', abbreviation: 'AS'},
{ name: 'ARIZONA', abbreviation: 'AZ'},
{ name: 'ARKANSAS', abbreviation: 'AR'},
{ name: 'CALIFORNIA', abbreviation: 'CA'},
{ name: 'COLORADO', abbreviation: 'CO'},
{ name: 'CONNECTICUT', abbreviation: 'CT'},
{ name: 'DELAWARE', abbreviation: 'DE'},