Skip to content

Instantly share code, notes, and snippets.

View ivanlemeshev's full-sized avatar
👨‍💻

Ivan Lemeshev ivanlemeshev

👨‍💻
  • Espoo, Finland
View GitHub Profile
@ivanlemeshev
ivanlemeshev / hexlet.slack.md
Last active August 26, 2015 19:48
тестирование

kirill.mokevnin [01:17] кстати, у хекслета ведь скрытая цель приучить людей к тестированию), вы все волей не волей сталкиваетесь с тестами и кто то даже изучает что там происходит, или что в итоге надо сделать.

kirill.mokevnin [01:18] Так вот эти тесты в нашей практике, они помогли кому то понять тестирование? Начать писать тесты?

ivanlemeshev [01:20] да, периодически в них смотрю, но писать не начал (

pgavrilov [01:21]

@ivanlemeshev
ivanlemeshev / wkhtmltopdf.md
Created August 26, 2015 09:54
HTML to PDF
$url = 'http://google.com';
$command = 'cd /path/to/pdf && wkhtmltopdf.sh ' . $url . ' filename.pdf';

exec($command);

if (file_exists("/path/to/pdf/filename.pdf")) {
    header('Content-type: application/pdf');
    header('Content-Disposition: attachment; filename="filename.pdf"');
 readfile('/path/to/pdf/filename.pdf');
@ivanlemeshev
ivanlemeshev / tail-call-fibonacci.js
Created August 4, 2015 16:32
JS: Tail-Call Fibonacci
function fibonacci(n) {
var fibonacciItr = function(a, b, n) {
if (n === 0) return a;
return fibonacciItr(b, a + b, n - 1);
};
return fibonacciItr(0, 1, n);
}
<?php
$encodedData = str_replace(' ', '+', $encodedData);
$decodedData = base64_decode($encodedData);
@ivanlemeshev
ivanlemeshev / rails_resources.md
Last active August 29, 2015 14:19 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@ivanlemeshev
ivanlemeshev / javascript_resources.md
Last active August 29, 2015 14:19 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage