This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
'use strict'; | |
const db = require('@arangodb').db; | |
const joi = require('joi'); | |
const createRouter = require('@arangodb/foxx/router'); | |
const sessionsMiddleware = require('@arangodb/foxx/sessions'); | |
const jwtStorage = require('@arangodb/foxx/sessions/storages/jwt'); | |
const createAuth = require('@arangodb/foxx/auth'); | |
const auth = createAuth(); | |
const router = createRouter(); |
# Sample as to how to initialize s3 client to work with Minio API compatible - https://github.com/minio/minio | |
# AWS CLI counterpart - https://docs.minio.io/docs/aws-cli-with-minio | |
import boto3 | |
s3 = boto3.resource('s3', | |
endpoint_url='http://<minio_IP>:9000', | |
config=boto3.session.Config(signature_version='s3v4') | |
) |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Timers; | |
namespace DebounceUtils | |
{ | |
/// <summary> | |
/// Event debouncer helps to prevent calling the same event handler too often (like mark Dirty or Invalidate) |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
events { | |
# nginx requires this section even when applying all default values | |
} | |
http { | |
# Upstream keyword is followed by a url (domain name/IP). This reference encapsulates | |
# the list of backend servers defined for a virtual proxy. When autnenticating | |
# a certificate from a backend server, the upstream url is supplied to the | |
# certificate authentication process instead of the backend server name. See | |
# the comments associated with proxy_pass below for a detailed discussion. |
# coding: utf-8 | |
"""Cause git to detect a merge conflict when two branches have migrations.""" | |
# myapp/management/commands/makemigrations.py | |
# you'll need myapp/management/commands/__init__.py and myapp/management/__init__.py in PY2, see Django docs | |
from __future__ import absolute_import, unicode_literals | |
import io | |
import os | |
import six |
This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
(r'^articles/(?P<year>\d{4}/?$, 'main.views.year'), | |
# When a use case comes up that a month needs to be involved as | |
# well, you add an argument in your regex: | |
(r'^articles/(?P<year>\d{4}/(?P<month>\d{2})/?$, 'main.views.year_month'), | |
# That works fine, unless of course you want to show something | |
# different for just the year, in which case the following case can be | |
# used, making separate views based on the arguments as djangoproject |