Skip to content

Instantly share code, notes, and snippets.

View melekes's full-sized avatar

Anton Kaliaev melekes

View GitHub Profile
@oguzbilgic
oguzbilgic / README.md
Created July 6, 2012 04:05
README.md scaffold for rails apps

MyApp

Very short description of the application.

1. Ruby, Rails & Rubygems

Applicatoin is written in ruby language, using Ruby on Rails web framework.

@Heimdell
Heimdell / flash_helper.rb
Created December 25, 2012 10:40
Flash helper library
module FlashHelper
[:success, :info].each do |kind|
define_method "flash_#{kind}" do |options = {}|
msg = options[:message] || kind
flash_notice message: msg, kind: kind, now: options[:now]
end
end
def flash_error(options = {})

Dashing Mailchimp Widget

Description

A Dashing widget to display your unread emails through Gmail using the Ruby Gmail gem.

Preview

Screen Shot

@owainlewis
owainlewis / java7.yml
Created July 24, 2013 10:45
Install Java 7 with Ansible on Ubuntu Linux
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@martinos
martinos / local_io.rb
Created January 28, 2013 22:56
For testing io stdin and stdout interaction.
module SpecHelper
def local_io(in_str)
old_stdin, old_stdout = $stdin, $stdout
$stdin = StringIO.new(in_str)
$stdout = StringIO.new
yield
$stdout.string
ensure
$stdin, $stdout = old_stdin, old_stdout
end
@hellosteadman
hellosteadman / twopy.py
Created March 4, 2014 09:59
Add your Twitter friends' RSS feeds to a single OPML file
"""
This script requires the following Packages
1: Twitter: https://pypi.python.org/pypi/twitter
2: PyQuery: https://pypi.python.org/pypi/pyquery
3: Jinja2: https://pypi.python.org/pypi/Jinja2
It's fairly primitive but works. It uses a Jinja2 template to create an OPML
file from the RSS feeds of the websites run by the people you follow on
Twitter.
@voidlizard
voidlizard / special-olympics-resume.md
Last active November 6, 2017 03:37
Специальная олимпиада имени memcpy: послесловие

Надеюсь, что теперь эта специальная олимпиада затихнет, потому что код-победитель только на ~20% уступает простой записи нулей в /dev/null.

При ближайшем рассмотрении, задача оказалась на скорость вывода в stdout, т.е. так как вход у неё довольно маленький (~10K элементов), то парсить практически всё равно как -- на любом языке из использовавшихся.

После понимания этого, задача сводится к эффективной буферизации вывода и размышлениям, почему же нигде не работает стандартная буферизация --- по идее, она должна делать именно

@mokevnin
mokevnin / Dockerfile
Last active December 16, 2017 14:19
hexlet.io: configuration management and deploy
FROM ruby:2.2.1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV RAILS_ENV production
ENV REFILE_CACHE_DIR /var/tmp/uploads
RUN curl -sL https://deb.nodesource.com/setup | bash -