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 / report
Created January 24, 2017 11:34
Sphinx 1.5.2 error report
Step 17/30 : RUN pip3 install grpcio
---> Running in b6d303f4091c
Downloading/unpacking grpcio
Running setup.py (path:/tmp/pip_build_root/grpcio/setup.py) egg_info for package grpcio
Installed /tmp/pip_build_root/grpcio/sphinx_rtd_theme-0.1.10_alpha-py3.4.egg
Searching for sphinx>=1.3
Reading https://pypi.python.org/simple/sphinx/
Best match: Sphinx 1.5.2
Downloading https://pypi.python.org/packages/e3/87/e271f7f0d498c7fdaec009c27955401d18ef357c0d468e1eb2be36bdc68c/Sphinx-1.5.2.tar.gz#md5=8a3068cd5dda49622b7eb5132d616e19

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all Tyk Technologies open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with Tyk Technologies, contributors or maintainers.

1. Grant of Copyright License.

@buger
buger / examples.md
Last active December 13, 2016 06:27
OssMetrics SQL access

We use latest unmodified Postgres (9.5.4), here is SQL documentation https://www.postgresql.org/docs/current/static/

Example of connecting to our database using psql command, with credentials which you should receive in email:

# After running it will ask your for the password. 
# For scripting purpose you may set password using PGPASSWORD environment variable as well.
psql -h ossmetrics.com -U <user>

You have access to events_ex table, each row represents single event happening in your repository

@buger
buger / time_tracker.sh
Last active July 26, 2017 21:13
Bash time tracker
active_time() {
# Query display logs
logs=$(/usr/bin/pmset -g log | grep 'Display is turned')
# By default Mac turn off monitor after 15 minutes
timeout=900
# Read logs line by line
# Line format: 2016-07-12 07:50:02 +0300 Notification Display is turned on
echo "$logs" | while IFS= read -r line; do
d=$(echo $line | cut -c 1-19); # extract full date
@buger
buger / atomic_counter.bash
Last active August 26, 2021 18:21
Bash atomic counter
# See http://wiki.bash-hackers.org/howto/mutex for more details
lock() {
if mkdir $1 &> /dev/null; then
return 0
else
r=$(($2 + 0))
# timeout after 5 retries
if [ "$r" -gt "5" ]; then
echo "Lock failed:" $1
@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) {