I hereby claim:
- I am coffee-cup on github.
- I am jakerunzer (https://keybase.io/jakerunzer) on keybase.
- I have a public key ASDTrMY_EQHLlcJ212YVW-cxv3wYPthoxTDlu48BUDqdpwo
To claim this, I am signing this object:
{ | |
"last" : true, | |
"photos" : [ | |
{ | |
"version" : 0, | |
"upload_date" : "2015-01-21T23:09:28.390Z", | |
"mount" : "\/data", | |
"_id" : 301, | |
"type" : "image\/jpeg", | |
"photo_data" : [ |
private int[] stringToIntArray(String text) { | |
int[] array = new int[text.length()]; | |
for (int i=0;i<text.length();i++) { | |
// maybe do check to see if charAt(i) is lower case character? | |
array[i] = (int) text.charAt(i) - (int) 'a'; | |
} | |
return array; | |
} |
{ | |
"always-semicolon": true, | |
"block-indent": " ", | |
"color-case": "upper", | |
"color-shorthand": false, | |
"element-case": "lower", | |
"eof-newline": true, | |
"leading-zero": false, | |
"quotes": "single", | |
"remove-empty-rulesets": true, |
I hereby claim:
To claim this, I am signing this object:
const callbackToPromise = method => (...args) => { | |
return new Promise((resolve, reject) => { | |
method(...args, (err, res) => { | |
if (err) reject(err); | |
resolve(res); | |
}) | |
}) | |
} | |
const callbackTimeout = (time, callback) => setTimeout(callback, time); |
// src/store/chat/types.ts | |
export const SEND_MESSAGE = "SEND_MESSAGE"; | |
export const DELETE_MESSAGE = "DELETE_MESSAGE"; | |
interface SendMessageAction { | |
type: typeof SEND_MESSAGE; | |
payload: Message; | |
} | |
interface DeleteMessageAction { |
// src/store/chat/reducers.ts | |
import { | |
ChatState, | |
ChatActionTypes, | |
SEND_MESSAGE, | |
DELETE_MESSAGE | |
} from './types' | |
const initialState: ChatState = { | |
messages: [] |
// src/thunks.ts | |
import { Action } from 'redux' | |
import { sendMessage } from './store/chat/actions' | |
import { AppState } from './store' | |
import { ThunkAction } from 'redux-thunk' | |
export const thunkSendMessage = ( | |
message: string | |
): ThunkAction<void, AppState, null, Action<string>> => async dispatch => { |
import * as firebase from "firebase/app"; | |
import { AnyAction } from "redux"; | |
import { ThunkAction } from "redux-thunk"; | |
import { State } from ".."; | |
import { Database } from "../../database"; | |
export interface ThunkExtraArguments { | |
firebase: firebase.app.App; | |
reactReduxFirebase: any; | |
database: Database; |
import * as React from "react" | |
import { connect } from "react-redux" | |
import { State } from "./types" | |
interface Props { /* ... */ } | |
interface EnhancedProps { /* ... */ } | |
const MyComponent: React.FC<Props & EnhancedProps> = props => ( | |
/* ... */ | |
) |