Skip to content

Instantly share code, notes, and snippets.

@Obooman
Obooman / app.js
Created April 4, 2017 10:27 — forked from bingeboy/app.js
Upload and display image with NodeJS and Express.
/*
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, common = require('./routes/common')
, fs = require('fs')
, http = require('http')
, util = require('util')
@Obooman
Obooman / index.android.js
Created June 9, 2017 04:42
New index.android.js writing for react-native-webview crosswalk.
/*
* You should replace path/to/project/node_modules/react-native-webview-crosswalk/index.android.js with current file.
* [email protected] & android 4.4.2 checked.
*/
import React, { PropTypes,PureComponent } from 'react';
import ReactNative, { requireNativeComponent, View } from 'react-native';
var {
NativeModules: { UIManager, CrosswalkWebViewManager: { JSNavigationScheme } }
@Obooman
Obooman / Demo.js
Created June 9, 2017 05:19
Demo gist for react-native-crosswalk-webview javascript execute question
// Main.js
...
<View style={{height:800}}>
<TouchableHighlight onPress={ this.inj }>
<Text>Fire</Text>
</TouchableHighlight>
<CrosswalkWebView
source = {{ uri:'http://url.any.com' }}
javaScriptEnabled={true}
@Obooman
Obooman / 0_reuse_code.js
Created June 30, 2017 03:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
class AutoExpandingTextInput extends React.Component {
state: any;
constructor(props) {
super(props);
this.state = {text: '', height: 0};
}
render() {
return (
<TextInput
@Obooman
Obooman / cloudSettings
Last active January 25, 2018 09:40
Demo code for bug react-navigation#2569
{"lastUpload":"2018-01-25T09:40:08.610Z","extensionVersion":"v2.8.7"}
@Obooman
Obooman / App.js
Created October 5, 2017 03:03
file for StackOverflow answer.
import React, { Component } from 'react';
import { Text, View, StyleSheet,Image,TouchableOpacity } from 'react-native';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Image
source={{ uri:"https://preview.ibb.co/e883Jw/2010_brown_bear.jpg" }}
style={ styles.imageWrapper }>
@Obooman
Obooman / integrate react-native to swift project.md
Created November 6, 2017 06:25 — forked from boopathi/README.md
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@Obooman
Obooman / terminal FBI warning.sh
Created November 13, 2017 08:07
display FBI warning login scene.
echo -e "
\e[41m\e[1m FBI \e[21mWARNING \e[49m
Federal Law probides servere civil and criminal penaltaties for
the unauthorized reproduction, distribution, or exhibition of
copyrighted mothion pictures(Title 17,United States Code,
Sections 501 and 508).The Federal Bureau of Investigation
@Obooman
Obooman / load.m
Created December 10, 2017 14:44
change rn load source url
// Run from locally running dev server
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
// Run on device with code coming from dev server on PC (change the IP to your PCs IP)
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.168:8081/index.ios.bundle"];
// For production load from pre-bundled file on disk. To re-generate the static bundle, run
// $ curl http://localhost:8081/index.ios.bundle -o main.jsbundle
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];