Skip to content

Instantly share code, notes, and snippets.

View buger's full-sized avatar
🏠
Working from home

Leonid Bugaev buger

🏠
Working from home
View GitHub Profile
@buger
buger / css_resources.md
Created June 6, 2014 10:34 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@buger
buger / rails_resources.md
Created June 6, 2014 10:34 — 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
@buger
buger / javascript_resources.md
Created June 6, 2014 10:34 — 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
@buger
buger / 0_reuse_code.js
Created June 6, 2014 10:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function renderList(list) {
var $list = $(list);
var $container = $list.parent();
var $items = $list.find('.list-item');
var count = $container.height() / 68;
var offset = $container.scrollTop() / 68;
$items.each(function(idx, el){
if (el.style.webkitTransform) {
=erl_crash_dump:0.1
Tue Apr 1 14:24:39 2014
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,ns_server,{bad_return,{{ns_server,start,[normal,[]]},{'EXIT',{timeout,{gen_server,call,[ale,{start_sink,disk_default,prefor
System version: Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:16] [kernel-poll:true]
Compiled: Fri Feb 14 08:43:08 2014
Taints:
Atoms: 9556
=memory
total: 19622904
processes: 3155936
@buger
buger / Normal.md
Last active December 28, 2015 11:09

Query:

SELECT predictions.site_id, SUM("shopper_orders"."total") AS sum_id FROM "predictions" INNER JOIN "shopper_orders" ON "shopper_orders"."uuid" = "predictions"."uuid" WHERE (predicted_at BETWEEN '2013-11-15 07:00:00' AND '2013-11-16 06:59:59') AND (control_group = 1) AND (shopper_orders.order_created_at > predictions.matched_at AND shopper_orders.order_created_at < (dateadd(h,24,predictions.matched_at)) AND (shopper_orders.cart_token = predictions.cart_token OR predictions.cart_token IS NULL OR predictions.cart_token = '')) GROUP BY predictions.site_id;

Explain:

Run time: 381ms

XN HashAggregate  (cost=0.65..0.66 rows=1 width=17)
<!--
This snippet loads the core Granify script.
** Remember to replace YOUR_SITE_ID with your actual Site ID **
-->
<script type="text/javascript">
(function (c, a) {
window.Granify = a;
var b, d, h, e;
b = c.createElement("script");
b.type = "text/javascript";
@buger
buger / gist:6922051
Last active December 25, 2015 05:09
TestUnit CircleCI screenshots
def teardown
@driver.save_screenshot File.join(ENV['CIRCLE_ARTIFACTS'], Time.now.strftime("%F_%H%M%S") + "_" + @method_name + ".png")
end
@buger
buger / Get IP address
Created September 13, 2013 15:22
Collection of useful code snipplets
# Get IP address of eth0 interface
ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }'