I hereby claim:
- I am h2non on github.
- I am h2non (https://keybase.io/h2non) on keybase.
- I have a public key whose fingerprint is F261 06C4 A327 FE10 8FE2 37B9 E63F AD85 FCFF 12F8
To claim this, I am signing this object:
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. | |
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. | |
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS! | |
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed. | |
- Conclusion, classifications, or results should ALWAYS appear last. | |
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. | |
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p |
def issubsubclass(cls, subcls): | |
""" | |
Recursively check if a given class has a subclass of `obj` class in the | |
subclasses hierarchy. | |
Under the hood, it does some metaprogramming magic recursively checking | |
the `__bases__` magic attribute. | |
Extends `issubclass` built-in function to check subclass hierarchies. |
I hereby claim:
To claim this, I am signing this object:
let parameters = [ | |
"username": "foo", | |
"password": "123456" | |
] | |
Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON) | |
// -> HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} |
A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)
I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.
A functor is something that supports map
.
/** | |
* Recursive implementation of string characters permutation | |
* covering all possible cases without duplication | |
*/ | |
function permute(str) { | |
var stack = [] | |
if (str.length === 1) { | |
return [ str ] | |
} |
package main | |
import ( | |
"fmt" | |
"gopkg.in/h2non/bimg.v0" | |
"os" | |
) | |
const operations = 10000 |
var fs = require('fs') | |
var pipefy = require('pipefy') | |
var AWS = require('aws-sdk') | |
var s3 = new AWS.S3() | |
// Keep safe the original function with proper scope | |
var putObject = s3.putObject.bind(s3) | |
// Override the function | |
s3.putObject = function (opts, cb) { |
vips cache : jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc20818e000, length = 877585 access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL) - | |
vips cache : jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc208358000, length = 877585 access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL) - | |
vips cache+: jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc20818e000, length = 877585 shrink=4 - | |
vips cache+: jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc208358000, length = 877585 shrink=4 - | |
vips cache : copy in=((VipsImage*) 0x70191b0) - | |
vips cache+: shrink in=((VipsImage*) 0x70191b0) xshrink=4.000000 yshrink=4.000000 - | |
vips cache : copy in=((VipsImage*) 0x70197f0) - | |
vips cache+: shrink in=((VipsImage*) 0x70197f0) xshrink=4.000000 yshrink=4.000000 - | |
vips cache : copy in=((VipsImage*) 0x7019980) - |
package bimg | |
import ( | |
"github.com/dustin/go-humanize" | |
. "github.com/tj/go-debug" | |
"runtime" | |
"strconv" | |
"time" | |
) |