Skip to content

Instantly share code, notes, and snippets.

View coolnalu's full-sized avatar
🌴

Terry Xu coolnalu

🌴
View GitHub Profile
@coolnalu
coolnalu / linux-box-common-problems.md
Last active August 12, 2018 01:10
Linux Box Common Problems

Wireless

git clone https://github.com/nazar-pc/RTL8814AU.git
cd RTL8814AU
sudo ./dkms-install.sh
sudo modprobe rtl8814au

Graphic Card / Fail to start X server

@coolnalu
coolnalu / react.native.flow.component.jsx
Last active January 25, 2018 02:44
React Native Sample Flow Component
import React, {Component} from 'react';
import {StyleSheet, Text} from 'react-native';
type Props = {
slogan: string
};
export default class Title extends Component<Props> {
render() {
return (<Text style={styles.welcome}>
import * as firebase from 'firebase';
const config = {
apiKey: 'api_secret',
authDomain: 'your-project.firebaseapp.com',
databaseURL: 'https://your-project.firebaseio.com',
projectId: 'your-project',
storageBucket: 'your-project.appspot.com',
messagingSenderId: '***'
};
@coolnalu
coolnalu / react.native.button.active.jsx
Created January 16, 2018 01:15
React Native Active Button Color
<TouchableHighlight
onPress={this.onPress}
underlayColor="#ffffff"
>
<Image source={buttonCreate} style={{
width: 80,
height: 80
}}/>
</TouchableHighlight>
@coolnalu
coolnalu / react.native.custom-font.jsx
Created January 16, 2018 00:34
React Native Change Font
import React, {Component} from 'react';
import {StyleSheet, Text} from 'react-native';
type Props = {
slogan: string
};
export default class Title extends Component<Props> {
render() {
return (<Text style={styles.welcome}>
@coolnalu
coolnalu / react.native.safe-area.jsx
Created January 16, 2018 00:17
Safe Area in React Native
import React, {Component} from 'react';
import {SafeAreaView, StyleSheet, View} from 'react-native';
// https://medium.com/react-native-training/react-native-iphonex-92ff511282af
export default class App extends Component < {} > {
render() {
return (<SafeAreaView style={styles.safeArea}>
<View/>
</SafeAreaView>);
}
@coolnalu
coolnalu / postgres_queries_and_commands.sql
Created June 4, 2017 22:41 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@coolnalu
coolnalu / build.sh
Last active May 28, 2017 18:20
Compiling TensorFlow on Ubuntu 16.04 LTS with Nvidia cuDNN and cuda
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package
@coolnalu
coolnalu / docker-commands.sh
Last active April 18, 2016 02:32
Docker commands
# List docker images/containers
docker images
docker ps
docker ps -a (include stopped containers)
# Remove docker images/containers
docker rmi image-sha
docker rm container-sha
# SSH into container
//////////////////////////////////////////////////////////
//
// Chater 4 - Tim's Era
//
//////////////////////////////////////////////////////////
extension Company {
func isBiggerThan(company: Company) -> Bool {
if marketCapital == nil || company.marketCapital == nil {