This file contains hidden or 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
/*eslint-disable no-undef*/ | |
import timeit from 'timeit' | |
import { createMatcher } from '../../../src/create-matcher' | |
fdescribe('Bench', function () { | |
const data = [] | |
for (let i = 0; i < 100; i++) { | |
const path = `/static/${i}` |
This file contains hidden or 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
const pathToRegexp = require('path-to-regexp') | |
const timeit = require('timeit') | |
const matcher = pathToRegexp('/a/b') | |
const matcherSimple = { | |
'/a/b': true | |
} | |
function use_regexp(done) { | |
matcher.exec('/a/b') |
This file contains hidden or 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
data "http" "gocache_response" { | |
url = "https://gocache.com.br/ips" | |
} | |
resource "aws_ec2_managed_prefix_list" "gocache" { | |
name = "gocache ips" | |
address_family = "IPv4" | |
max_entries = 30 | |
dynamic "entry" { |
This file contains hidden or 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
{"lastUpload":"2021-04-04T15:12:08.525Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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
from django.db import models | |
from django.db.models.query import ModelIterable | |
class BaseSerializer: | |
SELECT_RELATED = [] | |
PREFETCH_RELATED = [] | |
def prepare_queryset(self, qs): | |
if self.SELECT_RELATED: |
This file contains hidden or 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
In [1]: from django.conf import settings | |
...: from django.utils.module_loading import import_string | |
...: | |
...: | |
...: class ServiceFactory: | |
...: def __init__(self, django_setting): | |
...: self._django_setting = django_setting | |
...: | |
...: def __call__(self, import_str=None): | |
...: if import_str is None: |
This file contains hidden or 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
TMP_CONF=/tmp/awsips.conf | |
NGINX_CONF=/etc/nginx/conf.d/awsips.conf | |
AWS_REGION=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | jq .region | tr -d \") | |
if ! sudo nginx -t; then | |
echo CURRENT NGINX CONFIG IS BROKEN | |
exit 1 | |
fi | |
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r ".prefixes[] | select(.region==\"$AWS_REGION\" and .service==\"AMAZON\").ip_prefix" | xargs -i echo set_real_ip_from {}\; | sort > $TMP_CONF |
This file contains hidden or 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
<style type="text/css" scoped> | |
.mauticform_wrapper { max-width: 600px; margin: 10px auto; } | |
.mauticform-innerform {} | |
.mauticform-post-success {} | |
.mauticform-name { font-weight: bold; font-size: 1.5em; margin-bottom: 3px; } | |
.mauticform-description { margin-top: 2px; margin-bottom: 10px; } | |
.mauticform-error { margin-bottom: 10px; color: red; } | |
.mauticform-message { margin-bottom: 10px;color: green; } | |
.mauticform-row { display: block; margin-bottom: 20px; } |
This file contains hidden or 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
- run: | |
name: Download Coverage Artifacts | |
command: | | |
LAST_SUCCESSFUL_BUILD=`curl -u $CIRCLE_TOKEN: "https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME?filter=successful&limit=1" | grep '"build_url"' | grep -oE '[0-9]+'` | |
curl -u $CIRCLE_TOKEN: "https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$LAST_SUCCESSFUL_BUILD/artifacts" | grep -o 'https://[^"]*.json' | xargs -P4 -I % wget --force-directories --cut-dirs=1 --no-host-directories %?circle-token=$CIRCLE_TOKEN | |
for file in `find . -name '*\?*'`; do mv "$file" "${file%%\?*}"; done |
This file contains hidden or 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
from __future__ import unicode_literals | |
import os | |
import re | |
import time | |
import unicodedata | |
from collections import OrderedDict | |
from datetime import date | |
from optparse import OptionParser | |
from xml.dom.pulldom import START_ELEMENT, parse |
NewerOlder