Skip to content

Instantly share code, notes, and snippets.

View suhanlee's full-sized avatar
:octocat:
Focusing

kyle suhanlee

:octocat:
Focusing
View GitHub Profile
Mix.install(
[
{:phoenix_playground, "~> 0.1.0"},
{:openai, "~> 0.6.1"}
],
config: [
openai: [
api_key: System.get_env("OPENAI_API_KEY"),
organization_key: System.get_env("OPENAI_ORGANIZATION_KEY")
]
@suhanlee
suhanlee / S3-Static-Sites.md
Created June 24, 2019 18:22 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@suhanlee
suhanlee / constructor_statis.js
Created September 28, 2018 19:43
react native tips
class App extends Component {
constructor(props) {
super(props);
this.state = {
isConnected: true,
}
}
state = {
isConnected: true
@suhanlee
suhanlee / accounts.go
Created June 13, 2018 04:31
Eth accounts
type Account struct {
Address common.Address
URL URL
}
const AddressLength = 20
type Address [AddressLength]byte
@suhanlee
suhanlee / index.rb.erb
Last active June 6, 2018 05:37
custom mime format
# views/test/index.rb.erb
<%
@test =1
%>
<%= @test %>
@suhanlee
suhanlee / App.js
Created May 26, 2018 10:00
react navigation example
// In App.js in a new project
import React from 'react';
import { View, Text } from 'react-native';
import { createStackNavigator } from 'react-navigation';
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
@suhanlee
suhanlee / setup.js
Last active May 18, 2018 08:06
redux-segement-react-native
import { createStore, applyMiddleware } from ‘redux’;
import { takeEvery, call } from ‘redux-saga/effects’;
import createSegmentTracker from ‘redux-segment-node’;
import { navigateTo } from ‘gatsby-link’;
import { flow } from ‘lodash/fp’;
import { NAVIGATE_TO, GET_CLIENT_INFORMATION } from ‘~/shared/store/app/actionTypes’;
import { SEGMENT_KEY as key } from ‘~/shared/constants’;
import {
middlewares,
sagaMiddleware,
@suhanlee
suhanlee / webpack.config.js
Created May 6, 2018 21:19 — forked from tschoffelen/webpack.config.js
Tricking PHPStorm in supporting React Native path aliases.
/**
* Why is this here you ask? React Native doesn't use Webpack. True. This file is here to trick
* IDEA in recognizing module aliases (see the package.json files in some of the subdirs).
* Nice solution? No. Does it work? Sure.
* Tracker URL: https://youtrack.jetbrains.com/issue/WEB-23221
*
* - TS
*/
const fs = require('fs')
@suhanlee
suhanlee / AutoLink.js
Last active April 17, 2018 03:19
react-native-ui-components
@suhanlee
suhanlee / SlideIn.js
Created April 16, 2018 17:03
react-native-ui-animations
import React from 'react'
import PropTypes from 'prop-types';
import { Animated, Easing } from 'react-native'
class SlideIn extends React.Component {
constructor(props) {
super(props);
this.state = {
height: new Animated.Value(0),