As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
| import sqlalchemy as sa | |
| import sqlalchemy.orm as orm | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.ext.declarative import declared_attr | |
| from sqlalchemy.orm import scoped_session, sessionmaker | |
| DBSession = scoped_session(sessionmaker()) | |
| class BaseMixin(object): | |
| query = DBSession.query_property() | |
| id = sa.Column(sa.Integer, primary_key=True) |
| # Project Structure | |
| facebook/ | |
| runserver.py | |
| feed/ | |
| __init__.py | |
| views.py | |
| chat/ | |
| __init__.py | |
| views.py | |
| package test | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "testing" | |
| ) | |
| const INSERT_COUNT int = 10000 |
| // Intercepting HTTP calls with AngularJS. | |
| angular.module('MyApp', []) | |
| .config(function ($provide, $httpProvider) { | |
| // Intercept http calls. | |
| $provide.factory('MyHttpInterceptor', function ($q) { | |
| return { | |
| // On request success | |
| request: function (config) { | |
| // console.log(config); // Contains the data about the request before it is sent. |
| #OSX Tweaks: | |
| =========== | |
| - Most need reboot to show changes | |
| - Most of these tweaks are just for speed, but some are specific for development | |
| - All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign. | |
| - I'm not responsible for any adverse effects to your computer, at all. | |
| ##Increase the speed of OS X dialogs boxes: |
| // Create color style options | |
| add_theme_support( | |
| 'genesis-style-selector', | |
| array( | |
| 'latent-blue' => __( 'Blue', CHILD_DOMAIN ), | |
| 'latent-green' => __( 'Green', CHILD_DOMAIN ), | |
| 'latent-orange' => __( 'Orange', CHILD_DOMAIN ), | |
| 'latent-red' => __( 'Red', CHILD_DOMAIN ), | |
| ) | |
| ); |
| package main | |
| import ( | |
| "encoding/json" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) | |
| type Message struct { |