Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Vsevolod Strukchinsky floatdrop

🌴
On vacation
Block or report user

Report or block floatdrop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:37437071975bee51e02dfb9fca73608a
In file included from /Users/floatdrop/xtensor-benchmark/src/main.cpp:13:
/Users/floatdrop/xtensor-benchmark/src/benchmark_1D.hpp:61:46: error: no member named 'raw_data' in 'xt::xtensor_container<xt::uvector<double,
xsimd::aligned_allocator<double, 32> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>'
benchmark::DoNotOptimize(res.raw_data());
~~~ ^
In file included from /Users/floatdrop/xtensor-benchmark/src/main.cpp:14:
/Users/floatdrop/xtensor-benchmark/src/benchmark_2D.hpp:56:42: error: no member named 'raw_data' in 'xt::xtensor_container<xt::uvector<double,
xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major, xt::xtensor_expression_tag>'
benchmark::DoNotOptimize(res.raw_data());
~~~ ^
View bench.js
// matcha bench.js
var objectAssign = require('./');
var assert = require('assert');
bench('simple', function () {
assert.deepEqual(objectAssign({foo: 0}, {bar: 1}, {bar: 2}), {foo: 0, bar: 2});
assert.deepEqual(objectAssign({}, {}, {foo: 1}), {foo: 1});
assert.deepEqual(objectAssign({foo: 0}, {bar: 1}), {foo: 0, bar: 1});
assert.deepEqual(objectAssign({foo: 0}, null, undefined), {foo: 0});
View modulesizes.md
57628	browserify/node_modules/browserify-zlib/node_modules/pako/lib/zlib/deflate.js
46367	browserify/node_modules/browserify-zlib/node_modules/pako/lib/zlib/inflate.js
39267	browserify/node_modules/buffer/index.js
38588	browserify/node_modules/browserify-zlib/node_modules/pako/lib/zlib/trees.js
25381	browserify/node_modules/readable-stream/lib/_stream_readable.js
25381	got/node_modules/read-all-stream/node_modules/readable-stream/lib/_stream_readable.js
25381	got/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js
22257	browserify/node_modules/url/url.js
16593	browserify/node_modules/browserify-zlib/src/index.js
View app.js
var koa = require('koa');
var app = koa();
var backend = require('./backend');
var router = require('koa-router')();
router.get('/todo/', function *(next) {
var sid = yield backend.sessid();
this.body = yield {
sessid: sid,
@floatdrop
floatdrop / app.js
Last active Aug 29, 2015
Refactoring Tools!
View app.js
// Disclaimer: пример намеренно упрощен
var app = express();
app.get('/user/:id', function (req, res, next) {
if (req.params.id === '31337') {
res.send('Hello eleet!');
return;
}
@floatdrop
floatdrop / bench.js
Created Jun 17, 2015
Compare split performance
View bench.js
// npm i matcha -g
// matcha bench.js
bench('a', function() {
'a'.split('.');
});
bench('a.b', function() {
'a.b'.split('.');
});
@floatdrop
floatdrop / bench.js
Created Jun 14, 2015
Matcha benchmark for dot-prop
View bench.js
// npm i matcha -g
// matcha bench.js
var dotProp = require('./');
var testObject = {
a: {
b: {
c: {
d: {
View b_.with.jsx
var B = require('b_');
var Array_of = function (any) {
return Array.prototype.slice.call(any);
};
B.with = function () {
var b = this,
curriedArgs = Array_of(arguments);
View gist:68f04bf810bee92be128
❯ gulp watch:src
[21:53:09] Using gulpfile ~/test/gulpfile.js
[21:53:09] Starting 'watch:src'...
[21:53:09] Finished 'watch:src' after 14 ms
[21:53:09] Starting 'styles:src'...
[21:53:09] Finished 'styles:src' after 27 ms
[21:53:15] index.less was changed
[21:53:15] Starting 'styles:src'...
[21:53:15] Finished 'styles:src' after 8.76 ms
[21:53:18] index.less was changed
View gulpfile.js
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var watch = require('gulp-watch');
var less = require('gulp-less');
gulp.task('watch:src', function() {
watch({glob: 'styles/**/*.less'}, function(files) {
return gulp.start('styles:src');
});
});
You can’t perform that action at this time.