Skip to content

Instantly share code, notes, and snippets.

@ksmithut
ksmithut / .dockerignore
Last active April 26, 2024 14:04
Node Docker Compose nodemon
node_modules
@jonatansberg
jonatansberg / 0. Create React App (CRA) with TypeScript and Emotion.md
Last active December 21, 2020 15:47
Create React App (CRA) with TypeScript and Emotion

Set up CRA with TypeScript and Emotion

Follow the steps below to use babel together with ts-loader so that you can use emotion (or any other Babel plugin) in your React and TypeScript project.

$ create-react-app my-app --scripts-version=react-scripts-ts
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active March 18, 2024 09:08
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@opchaves
opchaves / mongodb-cheat-sheet.md
Last active September 10, 2022 21:51
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Connect to a database after starting mongo client

$ mongo
use dbname

Call this command before using a specific database. This command also creates the database, but the new database is only save when you insert the first document in a collection.

@gokulkrishh
gokulkrishh / media-query.css
Last active May 5, 2024 08:25
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 6, 2024 07:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@marktopper
marktopper / install.md
Last active March 24, 2023 14:49
Install Kong + Cassandra + Java [Ubuntu 14.04]

Installing Java

We need Java in order to have Cassandra running since Cassandra 2.0 and later require Java 7 or later. And we need Cassandra in order to run Kong.

So lets start installing Java 8 (the newest one)

First we add a repository to our build in order to manage the Java 8 package, since that is not normally supported by Ubuntu.

sudo add-apt-repository ppa:webupd8team/java
WebSockets vs. Server-Sent events/EventSource
---------------------------------------------
Both WebSockets and Server-Sent Events are capable of pushing data to browsers. To me they seem to be competing technologies.
What is the difference between them? When would you choose one over the other?
Websockets and SSE (Server Sent Events) are both capable of pushing data to browsers, however they are not competing technologies.
Websockets connections can both send data to the browser and receive data from the browser.
A good example of an application that could use websockets is a chat application.
@mpj
mpj / classless.md
Last active November 13, 2023 16:34

The future is here: Classless object-oriented programming in JavaScript.

Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.

Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.

I think it's really, really sleek, and this is what it looks like:

function dog(spec) {