Skip to content

Instantly share code, notes, and snippets.

View r17x's full-sized avatar
🤘
REconciling...

RiN r17x

🤘
REconciling...
View GitHub Profile
@r17x
r17x / reactJs.md
Created December 4, 2018 13:44
ReactJS Research. Tue 4 Desember 2018

componentDidUpdate -> triggered by forceUpdate or all everything update on props & state ( React.Component )
render -> triggered by componentDidUpdate ( note : not render if setState on purecomponent.componentDidMount() )

@r17x
r17x / python
Created November 17, 2018 06:21
python -m virtualenv py3 -p python3.7
from InstagramAPI import InstagramAPI as IG
from pprint import PrettyPrinter
from getpass import getpass
from random import randint
import time

pp =  PrettyPrinter(indent=2)

api = IG(
# example error
# scenario : 
$ yarn test (on react) # or
$ jest --watch

2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)

# solution
# install watchman 
@r17x
r17x / problem.md
Last active September 6, 2018 06:55
[Yarn] Docker Problem With yarn install

Problem: Unsuccessful deployment javascript application when update package.json

  • yarn
  • docker
# Example error Message
Step 4/8 : RUN yarn install
 ---> Running in hashnumber
yarn install v1.6.0
[1/4] Resolving packages...
[2/4] Fetching packages...
@r17x
r17x / sqlReport.md
Created September 4, 2018 04:27
SQL Lang for Report By Date (Weekly, Monthly, daily, & Yearly)

Daily:

SELECT year(userCreated), month(userCreated), day(userCreated), count(*)
FROM Users
GROUP BY year(userCreated), month(userCreated), day(userCreated)

Monthly:

SELECT year(userCreated), month(userCreated), count(*)
@r17x
r17x / Router-modified.js
Created August 28, 2018 07:18
Article:react-roles
import React, {Fragment} from 'react';
import {
BrowserRouter as Router,
Route,
Link
} from "react-router-dom";
import {Admin, User} from './Auth'; // Add this line
const Navigation = () => (
@r17x
r17x / Auth.js
Created August 28, 2018 04:45
Article:React-Roles
import React, {Component} from 'react';
/**
* Get User from Local Storage
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
* @return {obeject} UserData
* {
* username: string,
* role: string
* }
*/
@r17x
r17x / App.js
Last active August 28, 2018 04:44
Article:React-Roles
import React, { Component } from 'react';
//import logo from './logo.svg';
//import './App.css';
import Routers from './Router';
class App extends Component {
render() {
return <Routers/>;
}
}