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
# maybe.py - a Pythonic implementation of the Maybe monad | |
# Copyright (C) 2014. Milan Oberkirch <milan.py@oberkirch.org> | |
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 | |
# -*- coding: utf-8 -*- | |
import sys | |
import copy | |
PY2 = sys.version_info[0] == 2 | |
class Result(object): |
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 | |
# -*- coding: utf-8 -*- | |
import inspect | |
def iscoroutinefunction(fn): | |
if inspect.iscoroutinefunction(fn): | |
return True | |
if inspect.iscoroutinefunction(getattr(fn, "__call__", None)): | |
return True |
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 time import time | |
def start(context): | |
context.log("Format: [send data timing] [waitting timing] [receive data timing] Request URL") | |
def request(context, flow): | |
context.started_at = time() | |
def response(context, flow): | |
sending = flow.request.timestamp_end - flow.request.timestamp_start |
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 | |
# -*- coding: utf-8 -*- | |
from os import environ, path, makedirs | |
import imghdr | |
from datetime import datetime, timedelta | |
from concurrent.futures import ThreadPoolExecutor | |
from tornado import gen | |
from tornado.concurrent import run_on_executor |
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 | |
usage() | |
{ | |
cat <<EOF | |
Usage: $(basename $0) [options] | |
This shell script is a simple wrapper around the openssl binary. It uses | |
s_client to get certificate information from remote hosts, or x509 for local | |
certificate files. It can parse out some of the openssl output or just dump all |
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
use std::fs::File; | |
use std::io::BufRead; | |
use std::io::BufReader; | |
use std::path::Path; | |
struct Hit { | |
ip: String, | |
datetime: String, |
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 | |
# virtualenv-auto-activate.bash | |
# | |
# Installation: | |
# Add this line to your .bashrc or .bash-profile: | |
# | |
# source /path/to/virtualenv-auto-activate.bash | |
# | |
# Go to your project folder, run "virtualenv .venv", so your project folder | |
# has a .venv folder at the top level, next to your version control directory. |
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
var path = require("path"); | |
var gulp = require("gulp"); | |
var less = require("gulp-less"); | |
var notify = require("gulp-notify"); | |
var rename = require("gulp-rename"); | |
var minifyCSS = require("gulp-minify-css"); | |
var uglify = require("gulp-uglifyjs"); | |
var livereload = require("gulp-livereload"); | |
var source = require("vinyl-source-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
import Cocoa | |
class A { | |
var foo : () -> String | |
var baz : Int | |
init () { | |
func _foo () -> String { | |
return "halo" | |
} |