Skip to content

Instantly share code, notes, and snippets.

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

Abdul Fattah Ikhsan ikhsanalatsary

🏠
Working from home
View GitHub Profile
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@ikhsanalatsary
ikhsanalatsary / immutablePersistReducer.js
Created March 22, 2018 05:38
redux-persist persistReducer with seamless-immutable
// @flow
import {
FLUSH,
PAUSE,
PERSIST,
PURGE,
REHYDRATE,
DEFAULT_VERSION
} from 'redux-persist'
import Foundation
func fibonacci (until n: Int) -> [Int] {
var num1 = 0
var num2 = 1
var fibonacciNumber = [Int]()
for _ in 0...n {
let temp = num1
num1 = num1 + num2
num2 = temp
@ikhsanalatsary
ikhsanalatsary / AppDelegate.swift
Created August 26, 2018 06:20
AppDelegate untuk React Native
//
// AppDelegate.swift
// ReactNativeSwift
//
// Created by Gabriel Lai on 26/8/18.
// Copyright © 2018 Facebook. All rights reserved.
//
import UIKit
@ikhsanalatsary
ikhsanalatsary / AppDelegate.swift
Created August 26, 2018 07:07
AppDelegate dengan UIApplicationMain untuk React Native
//
// AppDelegate.swift
// ReactNativeSwift
//
// Created by Gabriel Lai on 26/8/18.
// Copyright © 2018 Facebook. All rights reserved.
//
import UIKit
@ikhsanalatsary
ikhsanalatsary / ReactNativeSwift-Bridging-Header.h
Created August 26, 2018 08:58
Bridging Header untuk React Native
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@ikhsanalatsary
ikhsanalatsary / main.swift
Last active August 26, 2018 09:49
File main untuk React Native
//
// main.swift
// ReactNativeSwift
//
// Created by Gabriel Lai on 25/8/18.
// Copyright © 2018 Facebook. All rights reserved.
//
import UIKit
@ikhsanalatsary
ikhsanalatsary / gist:819fd94c4cc32950831aa02472641dc4
Created September 1, 2018 03:08 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@ikhsanalatsary
ikhsanalatsary / ReactNativeSwift-Bridging-Header.h
Created September 29, 2018 11:47
Import Codepush into Bridging Header
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <CodePush/CodePush.h>
@ikhsanalatsary
ikhsanalatsary / AppDelegate.swift
Created September 30, 2018 23:28
ifdef in Swift
//
// AppDelegate.swift
// ReactNativeSwift
//
// Created by Gabriel Lai on 26/8/18.
// Copyright © 2018 Facebook. All rights reserved.
//
import UIKit