Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / testing.md
Created November 29, 2016 19:00 — forked from dwbuiten/testing.md

Things to Look for When Evaluating Encoders

"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.

First Steps

  1. First, verify they actually have a product to sell that actually exists and can be tested in-house.

    Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.

@julik
julik / testing.md
Created November 29, 2016 19:00 — forked from dwbuiten/testing.md

Things to Look for When Evaluating Encoders

"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.

First Steps

  1. First, verify they actually have a product to sell that actually exists and can be tested in-house.

    Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@julik
julik / gist:1961385
Created March 2, 2012 21:04 — forked from tvandervossen/gist:1958155
How to define a 400 by 200 px sprite image with a 800 by 400 px retina display version
.ui
{
  background-image: url(sprite.png);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
  .ui
  {
    background-image: url(sprite2x.png);
    background-size: 400px 200px;
  }
@julik
julik / config.ru
Created February 29, 2012 18:26
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
require "rails"
# Let's load only action controller. If you want
# to use active record, just require it as well.
require "action_controller/railtie"
class MyApp < Rails::Application
require "net/http"
# Veeery simple recaptcha client.
# In your controller or filter
# @recaptcha = Recaptcha.new(:pubkey => your_public_key, :privkey => your_private_key)
# In the view
# <%= @recaptcha.form %>
# In the accepting action, rescue from Recaptcha::Failed
# begin
# @recaptcha.verify!(:env => env, :params => params)
@julik
julik / deploy.rb
Created February 16, 2010 17:50 — forked from kpumuk/deploy.rb
namespace :deploy do
desc 'Bundle and minify the JS and CSS files'
task :precache_assets, :roles => :app do
root_path = File.expand_path(File.dirname(__FILE__) + '/..')
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first
assets_path = "#{root_path}/public/assets"
# Precaching assets
run_locally "ruby -I#{yui_lib_path} #{jammit_path}"
# Author: Cyril Rohr
require 'rubygems'
require 'rest_client' # sudo gem install rest-client
require 'rack/cache' # sudo gem install rack-cache
module RestClient
# this is a quick hack to show how you can use rack-cache as a powerful client cache.
class CacheableResource < Resource
attr_reader :cache
CACHE_DEFAULT_OPTIONS = {}.freeze
Symptoms may include:
1. Knowing that you will have to write a router for the 10th time just because someone said YAGNI
(and knowing that having said "router" you would likely want it _both_ ways, yes I mean it thank you)
2. When talking about yourself as a developer you say
things like "I escape my URLs and preferably auto, and yes this includes the router"
3. You know you just don't need to rememder to have a form tag without do..end. because you use markaby anyway.
And you want your URL escaped
4. It doesn't feel right unless you have snatched escape_and_sanitize_ugly_html_gunk from bigframework and
of course you find out that it requires bigframework-*.gem, and the backing class for escape_and_sanitize