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
| # This code is under the MIT license. | |
| # Inspired by this StackOverflow question: | |
| http://stackoverflow.com/questions/3295405/creating-django-objects-with-a-random-primary-key | |
| import struct | |
| from Crypto.Cipher import DES | |
| from django.db import models | |
| def base36encode(number): |
| # put the following in your usercustomize.py file. | |
| # see https://33ad.org/blog/pycon-2011-and-colorized-pdb-source-listings | |
| # for more info and explanation. | |
| # colorize pdb source output | |
| import pdb | |
| import StringIO | |
| from pygments import highlight | |
| from pygments.lexers import PythonLexer, PythonTracebackLexer | |
| from pygments.formatters import TerminalFormatter |
| !------------------------------------------------------------------------------- | |
| ! Xft settings | |
| !------------------------------------------------------------------------------- | |
| Xft.dpi: 96 | |
| Xft.antialias: false | |
| Xft.rgba: rgb | |
| Xft.hinting: true | |
| Xft.hintstyle: hintslight |
| #!/bin/sh | |
| #Yes, there is no six | |
| hosts=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9) | |
| names=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9) | |
| sessions=(1 2 3 4 5 7 8 9) | |
| tmux new-session -d -s pipelines | |
| i=0 |
| #!/usr/bin/env python | |
| import os | |
| import random | |
| import time | |
| import platform | |
| snowflakes = {} | |
| try: | |
| # Windows Support |
| $ -> | |
| Event = Backbone.Model.extend() | |
| Events = Backbone.Collection.extend({ | |
| Model: Event, | |
| url : 'events' | |
| }) | |
| EventsView = Backbone.View.extend({ | |
| initialize: -> |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| wget -q -O - https://raw.github.com/gist/2204072/install_tmux_1.6_on_ubuntu_10.04.sh | sudo bash |
These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.
Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.