Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
@bookercodes
bookercodes / redirect-map.json
Created March 19, 2024 07:50
Map from scrimba.com/podcast to podcast.scrimba.com episode links (including the script)
{
"map": [
{
"from": "https://scrimba.com/podcast/getting-your-first-developer-job",
"to": "https://podcast.scrimba.com/1"
},
{
"from": "https://scrimba.com/podcast/bus-driver-becomes-developer",
"to": "https://podcast.scrimba.com/2"
},
import { createServer } from 'http'
import { WebSocketServer } from 'ws'
import { parse } from 'url'
const PORT = 8000
const server = createServer()
// noSever: Tells WebSocketServer not to create an HTTP server
// but to instead handle upgrade requests from the existing
// server (above).
const wsServer = new WebSocketServer({ noServer: true })
const foo = require("foo")
const boo = require("boo")
foo.seconds(2) // 2000
foo.minutes(2) // 120000
boo.seconds(2000) // 2
boo.minutes (120000) // 2

Kbd map

  • ESC + HJKL

  • ESC + F1, F3, etc. 👆 I don't want my mech keyboard binsd to be too different from what I would use on the Mac

  • Caps + HJKL to navigate windows\

  • Caps + Shift + HJKL to move windows around

{
"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",