(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "strconv" | |
| "github.com/miekg/dns" | |
| ) |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env python | |
| # jsonenv reads a json object as input and produces | |
| # escaped shell commands for setting environment vars | |
| import json | |
| import pipes | |
| import sys | |
| for k, v in json.load(sys.stdin).items(): |
| #!/bin/bash | |
| # SPDX-License-Identifier: MIT | |
| ## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com> | |
| ## | |
| ## This script is licensed under the terms of the MIT license. | |
| ## https://opensource.org/licenses/MIT | |
| # | |
| # Lockable script boilerplate | |
| /* | |
| Create a Mask in an email address | |
| This function create a mask using a valid email address. | |
| This is usefull when someone need to confirm the email used in a system | |
| Author: Gabriel Froes - https://gist.github.com/gabrielfroes | |
| */ | |
| function emailMask(email) { | |
| var maskedEmail = email.replace(/([^@\.])/g, "*").split(''); | |
| var previous = ""; | |
| for(i=0;i<maskedEmail.length;i++){ |
| """ | |
| Middleware to log all requests and responses. | |
| Uses a logger configured by the name of django.request | |
| to log all requests and responses according to configuration | |
| specified for django.request. | |
| """ | |
| # import json | |
| import logging | |
| from django.utils.deprecation import MiddlewareMixin |
| import re, logging | |
| from django.conf import settings | |
| from django.core.handlers.wsgi import STATUS_CODE_TEXT | |
| req_handler = logging.FileHandler(settings.HOME_DIR + '/logs/requests.log') | |
| req_handler.setLevel(logging.INFO) | |
| formatter = logging.Formatter('[%(asctime)s] %(message)s') | |
| req_handler.setFormatter(formatter) |