Skip to content

Instantly share code, notes, and snippets.

View febritecno's full-sized avatar
🏠
Working from home

Febrian Dwi Putra febritecno

🏠
Working from home
  • linkedin.com/in/febrian-dwi-putra
  • Bojonegoro, indonesia
  • 01:56 (UTC +07:00)
View GitHub Profile
@febritecno
febritecno / flutter_cheatsheet.md
Created October 22, 2018 16:36 — forked from vmwsree/flutter_cheatsheet.md
Cheat Sheet For Flutter

Container to be full width

constraints: BoxConstraints.expand() so the child a column can have expanded

Outlined Text Box

TextField(
  controller: _usernameController,
  decoration: InputDecoration(
@febritecno
febritecno / css-selectors.md
Created November 23, 2018 00:18 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@febritecno
febritecno / The Rules.md
Created November 23, 2018 00:22 — forked from sebmarkbage/The Rules.md
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

A Better ListView for React Native

I have a proposal for some new APIs, and a first draft on an implementation (first diff: D4412469). Salient points on the new APIs:

  • Two easy-to-use components: FlatList and SectionList. I have found that separating the section API out makes things a lot cleaner for both cases.

  • One shared underlying implementation, VirtualizedList, which has an API similar to react-virtualized and uses getter functions to be very flexible and supports any kind of data structure such as a plain array or an immutable list.

  • Naming adjustments to make it horizontal agnostic, e.g. "Item" instead of "Row".

@febritecno
febritecno / what-forces-layout.md
Created November 23, 2018 00:26 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@febritecno
febritecno / react-lifecycle-cheatsheet.md
Created November 23, 2018 00:26 — forked from bvaughn/react-lifecycle-cheatsheet.md
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@febritecno
febritecno / google-dorks
Created December 20, 2018 13:46 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
//git program folder path
C:\Program Files\Git
cd /c/"Program Files"/Git
git clone https://github.com/git-ftp/git-ftp git-ftp.git
cd git-ftp.git && chmod +x git-ftp
cp /c/"Program Files"/Git/git-ftp.git/git-ftp /c/"Program Files"/Git/bin/git-ftp
git config git-ftp.url ftp://ftp.yourdomain.com/public_html/whatever_path
@febritecno
febritecno / App.js
Created March 29, 2019 01:15 — forked from ktec/App.js
HOW TO USE PHOENIX WITH WEBPACK + REACT + REDUX - This is a collection of small changes related to: https://www.dailydrip.com/blog/how-to-use-phoenix-with-webpack-react-redux.html
import React, { Component } from "react";
import { connect } from "react-redux";
import MessageList from "../components/MessageList";
import MessageInput from "../components/MessageInput";
import Actions from "../actions";
function App(props) {
const { messages, sendMessage } = props;
return (
#importing the python requests library
import requests
def get_scores():
url = "https://cricscore-api.appspot.com/csa"
#Creatin a GET request
response = requests.get(url)