Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
{
"faq": [
{
"question": "Why is React popular?",
"answer": "React initially skyrocketed 🚀 to fame because it made fetching and showing data in your JavaScript apps much easier than before. Because React is \"just\" a library instead of an elaborate framework, it was - and still is - relatively easy to learn. In 2020, we love React for its mobile support through React Native, excellent developer tools, and helpful community."
},
{
"question": "Who uses React?",
"answer": "Facebook built React for their own products, which include Facebook, Instagram, and WhatsApp . React is also used by Netflix, The New York Times, AirBnb, Discord, DropBox, and many other big companies you've heard of."
},
<MessageList messages={state.messages} renderMessage={message => <Message {...message } /> } />

renderMessage is an optional parameter.

The default behaviour for renderMessage is illustraed above. If you would like to render your own message, you can define a custom function. Make sure to return a div with .div { display: block } so that automatic scrolling to the bottom works.

{
"url": "http://ghostnew.cometchat-dev.com/tutorials",
"server": {
"port": 2368,
"host": "127.0.0.1"
CometChat.login(UID: "bendewberry", apiKey: "API_KEY", onSuccess: { (user) in
print("Login successful : " + user.stringValue())
})
let textMessage = TextMessage(
receiverUid: "#General",
text: "Hi everyone",
messageType: .text,
receiverType: .group)
CometChat.init(this, "APP_ID", object : CometChat.CallbackListener<String>() {
override fun onSuccess(p0: String?) {
Log.d(TAG, "Initialization completed successfully")
}
})
CometChat.login("bendewberry", object : CometChat.CallbackListener<User>() {
override fun onSuccess(p0: User?) {
Log.d(TAG, "Login Successful : " + p0?.toString())
}
CometChat.init(this, "APP_ID", new CometChat.CallbackListener<String>() {
@Override
public void onSuccess(String successMessage) {
Log.d(TAG, "Initialization completed successfully");
}
});
TextMessage textMessage = new TextMessage(
"#General",
"Hi everyone",
await CometChat.init(process.env.COMETCHAT_APP_ID)
const user = await CometChat.login("bendewberry")
// Send message to "#General" group
const message = new CometChat.TextMessage(
"#General",
"Hello everyone",
CometChat.MESSAGE_TYPE.TEXT,
CometChat.RECEIVER_TYPE.GROUP)
await CometChat.sendMessage(message)
class Chat extends Component {
constructor() {
this.state = {
messages: []
}
}
async onComponentDidMount() {
await CometChat.init(process.env.appId)
this.user = await CometChat.login("bendewberry")
set -as terminal-overrides ",*-256color:Tc"
set -g prefix C-Space
set-window-option -g mode-keys vi
bind-key , command-prompt "rename-window '%%'"
set -g status-right '#H %a %d %H:%M #{prefix_highlight}'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'