Skip to content

Instantly share code, notes, and snippets.

View Kudo's full-sized avatar

Kudo Chien Kudo

View GitHub Profile
@cnevinc
cnevinc / CustomView.java
Last active September 23, 2015 12:44
code snippet for custom view
public CustomView(Context context, AttributeSet attrs) {
super(context, attrs);
setupBackPressed();
}
public static void addMe(Activity host) {
NotificationView v = (NotificationView) host.getLayoutInflater().inflate(R.layout.notification_list, null);
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
host.addContentView(v, p);
@gabecoyne
gabecoyne / DimensionsHelper.js
Last active October 18, 2016 12:14
React Native Android ViewPager
'use-strict'
var React = require('react-native');
var {
Dimensions
} = React;
var DimensionsHelper = {
init : function() {
this.SCREEN_WIDTH = Dimensions.get("window").width;
/*! webpack.config.js | Build JS, CSS,.. client assets and StyleGuide */
'use strict';
var webpack = require('webpack');
var ExtractTextWP = require('extract-text-webpack-plugin');
var HtmlWP = require('html-webpack-plugin');
var path = require('path');
var moment = require('moment');
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active December 19, 2025 05:46
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {

NavigationExperimental notes

Containers

RootNavigationContainer

  • You pass the reducer to this, it actually ultimately receives all navigation calls via onNavigate, which is mostly equivalent to Redux dispatch. It setState and persisting state. it is like the redux "store"
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@sibelius
sibelius / Codemod RN24 to RN25.md
Last active November 9, 2016 13:09
Codemod React Native 24 imports to RN25 imports

README

Why this transform is necessary?

Until React Native 24, you import React from 'react-native' package, but this will change on RN 25, you will need to import React from 'react'. You probably have many files that does this, so I've created a codemod to save you a bunch of time

How to use this

  • Install jscodeshif
@kelset
kelset / build-time-improvements.md
Last active June 23, 2025 14:22
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.