Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
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 os | |
from app import app | |
from app.database import db_session | |
from app.models.achievement import Achievement | |
from app.forms.achievement import AchievementForm | |
from flask import Blueprint, render_template, abort, request, redirect, flash, url_for | |
from werkzeug import secure_filename |
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
#!/bin/bash | |
# | |
BACKUPDEST="$1" | |
DOMAIN="$2" | |
MAXBACKUPS="$3" | |
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then | |
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]" | |
exit 1 |
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
# | |
# Converts eastings and northings (British national grid coordinates) to Lat/Long | |
# | |
# Original code author: Hannah Fry; see code/comments here: | |
# http://www.hannahfry.co.uk/blog/2012/02/01/converting-british-national-grid-to-latitude-and-longitude-ii | |
# | |
from math import sqrt, pi, sin, cos, tan, atan2 as arctan2 | |
import csv |
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
# SYNTAX: | |
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
var pattern = /pattern/attributes; # same as above | |
# BRACKETS: | |
[...]: Any one character between the brackets. | |
[^...]: Any one character not between the brackets. |
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
the | |
of | |
to | |
and | |
a | |
in | |
is | |
it | |
you | |
that |
We can't make this file beautiful and searchable because it's too large.
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
StartIP,EndIP,StartIPInt,EndIpInt,CountryCode,Country | |
"1.0.0.0","1.0.0.255","16777216","16777471","AU","Australia" | |
"1.0.1.0","1.0.3.255","16777472","16778239","CN","China" | |
"1.0.4.0","1.0.7.255","16778240","16779263","AU","Australia" | |
"1.0.8.0","1.0.15.255","16779264","16781311","CN","China" | |
"1.0.16.0","1.0.31.255","16781312","16785407","JP","Japan" | |
"1.0.32.0","1.0.63.255","16785408","16793599","CN","China" | |
"1.0.64.0","1.0.127.255","16793600","16809983","JP","Japan" | |
"1.0.128.0","1.0.255.255","16809984","16842751","TH","Thailand" | |
"1.1.0.0","1.1.0.255","16842752","16843007","CN","China" |
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
#!/usr/bin/env python | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the run() method |
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
license: gpl-3.0 |
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
<!DOCTYPE html> | |
<style> | |
#chart { | |
width: 960px; | |
height: 500px; | |
} | |
#chart rect.bar { | |
stroke: black; | |
fill: #777; |
NewerOlder