Skip to content

Instantly share code, notes, and snippets.

View palexs's full-sized avatar

Alexander palexs

View GitHub Profile
@palexs
palexs / notes.md
Last active November 16, 2022 08:12
Ultimate Intro to Ethereum Ðapp Development Course Synopsis

1. Provisioning the Development Environment

brew install node
npm install -g ethereumjs-testrpc
package.json:
{
@palexs
palexs / scroll-view-with-pagination.js
Last active December 19, 2018 15:07
ScrollView with pagination
import React, { Component } from 'react';
import { View, StyleSheet, ScrollView, Dimensions } from 'react-native';
const { width } = Dimensions.get('window');
export default class App extends Component {
componentDidMount() {
setTimeout(() => {this.scrollView.scrollTo({x: -30}) }, 100) // scroll view initial position fix
}
@palexs
palexs / git.md
Last active December 31, 2018 12:42
Git useful commands
  • Remove all local branches except for master:

git branch | grep -v “master” | xargs git branch -D

  • Remove all remote (origin) branches except for master and HEAD:

git branch -r | grep origin/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push origin :$line; done;

@palexs
palexs / Flutter
Last active April 18, 2019 12:36
Streams are a way to get data from one place in our app to another.
*** DART FUNCTION PARAMS ***
void test1({ int one, String two: 'default' }) {
print(one);
print(two);
}
void test2(int main, { int one }) {
@palexs
palexs / caching.md
Last active September 16, 2019 15:40

CURRENT CACHING LAYER

magnetFetch (src/lib/magnetFetch/magnetFetch.js)

Data is cached when the request is a GET and when any max-age is provided.

  • GET is reading a server resource; other requests are for modification. The expectation for the app is that a modification should fail if it can't hit the server, and that it should always know when a modification fails. Therefore cached data is not appropriate for non GET requests.
  • when max-age == 0 it means that the response is valid for offline mode,
@palexs
palexs / RN-arch.md
Created November 29, 2019 14:01
RN re-architecture