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
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux. | |
package main | |
import ( | |
"net/http" | |
"slices" | |
) | |
type ( | |
middleware func(http.Handler) http.Handler |
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
package main | |
import ( | |
"context" | |
"crypto/tls" | |
"encoding/binary" | |
"errors" | |
"io" | |
"log" | |
"net/url" |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func gen(done <-chan struct{}, nums ...int) <-chan int { | |
out := make(chan int) | |
go func() { |
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
from __future__ import print_function | |
from tornado.gen import Task, Return, coroutine | |
import tornado.process | |
import subprocess | |
from tornado.ioloop import IOLoop | |
STREAM = tornado.process.Subprocess.STREAM | |
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
/path/to/location/ method=POST contents="name=TEST&password=SECRET" |
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
from django import forms | |
from django.forms.forms import BoundField | |
from django.utils.datastructures import SortedDict | |
class BoundFieldset(object): | |
def __init__(self, form, name, title, fields, is_fieldset): | |
self.form = form | |
self.name = name |
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
package main | |
import ( | |
"bytes" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"golang.org/x/crypto/openpgp/armor" |
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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"os/exec" | |
"gopkg.in/xmlpath.v2" | |
) |
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
#python manage.py runserver --noreload | |
from django.conf.urls import patterns, include, url | |
from django.conf import settings | |
from django.http import HttpResponse | |
import sys | |
def reload_urls(request, urlconf=None): | |
if urlconf is None: | |
urlconf = settings.ROOT_URLCONF |
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
# coding: utf-8 | |
# | |
# Copyright (c) Alexandr Emelin. BSD license. | |
# All rights reserved. | |
# | |
""" | |
class GithubAuthHandler(BaseHandler, auth.GithubMixin): | |
x_site_token = 'application' |
NewerOlder