Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command | usage | |
---|---|---|
git init | Creates an empty Git repository in the specified directory. | |
git clone <repository name> | Clones a repository located at <repository name> onto your local machine. | |
git add <directory> | Stages only the specified changes for the next commit. Replace <directory> with a <file> to change a specific file. | |
git add . | Stages new files and modifications without deletions | |
git add -A | Stages all changes | |
git add -all | Equivalent to git add -A | |
git add -u | Stages modifications and deletions without adding new files | |
git add --update | Equivalent to git add -u | |
git commit -m ”<message>” | Commits the staged snapshot. replace <message> with the commit message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = firebase.firestore(); | |
var content = require("./sourceData.json"); | |
content && | |
Object.keys(content).forEach(contentKey => { | |
const nestedContent = content[contentKey]; | |
if (typeof nestedContent === "object") { | |
Object.keys(nestedContent).forEach(docTitle => { | |
firebase | |
.firestore() |
Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"
I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)
Main features:
- Django REST APIs
- ReactJS with Redux Pattern
- Webpack module bundler manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Add CORS headers for tastypie APIs | |
Usage: | |
class MyModelResource(CORSModelResource): | |
... | |
class MyResource(CORSResource): | |
... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import weather | |
import smtp | |
''' | |
Send a greeting email to our customer email list | |
with the daily weather forecast and schedule | |
''' | |
def get_emails(): | |
# Reading emails from a file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package supercat1; | |
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; // Using Swing components and containers | |
import java.util.Timer | |
// A Swing application extends javax.swing.JFrame | |
public class supercat1 extends JFrame { | |
private JTextField tfCount; | |
// Use Swing's JTextField instead of AWT's TextField |