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:
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" | |
) |
#!/bin/sh | |
# | |
# Orinally made by Lovell Fuller for sharp | |
# https://github.com/lovell/sharp | |
# | |
# Usage: | |
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash - | |
# |