Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
alias buby='bundle exec ruby'
alias brake='bundle exec rake'
alias bapistrano='bundle exec cap'
alias brackup='bundle exec rackup'
alias breakup='bundle exec rackup'
alias brails='bundle exec rails'
alias botgun='bundle exec shotgun --port 9292'
alias boreman='bundle exec foreman start'
alias brunicorn='bundle exec unicorn --port 9292'
alias bundel='bundle' # how Dutch
import nuke,os
IMPULSE_FILTER_ENUM = 0
__version__ = (0,0,1)
def grow():
"""
Will make a Crop node that crops the frame to the union of the animated BBox of the nude currently selected.
For example, if you have a Tracker node that stabilizes an image this function will grow your bounding box
to include the whole stabilized image
"""
# This line makes me sad
Faraday::Adapter.register_middleware File.expand_path(File.dirname(__FILE__)),
:certificate_pinning => [:CertificatePinning, 'certificate_pinning/certificate_pinning']
Faraday.new(:url => 'https://fancy-startup.io/api') do |f|
f.use :http_cache, store: @cache
f.request :url_encoded
f.response :logger
require 'faraday'
class CertificatePinning < Faraday::Adapter::NetHttp
def configure_ssl(http, ssl)
super # configure MOAR SSL }
end
end
client = Faraday.new(:url => 'https://github.com') do |f|
f.request :url_encoded
  • Why I need to rename stuff (again) when moving from minitest 4 to minitest 5?
  • Why a 0.x upgrade of ActiveRecord forces my project to minitest 5 even though my project is on 4?
  • Why Rake runs the autorunner for every thread I start within my rake task that has nothing to do with minitest?
  • Why there is no "around wrapper" for every test method that is published, and if there is why did it's API had to change between 4 and 5?
  • When I require "test/unit" because somethign in my project wants to have Test::Unit, is that really necessary?
  • Who is responsible/maintaining the test task that is supplied in Rake?
@julik
julik / passthrough_tgz.rb
Created June 19, 2014 23:57
Do not double-cook tarballs when serving them via Rack
# Wrapper for Rack::Deflater that will prevent
# the said Deflater from EVER touching .tgz files
class PassthroughDeflater
BYPASS_FILES = /\.(t?)gz$/
# bypass_url_regexp will be matched against PATH_INFO
def initialize(app, bypass_url_regexp = BYPASS_FILES)
@bypass_url_regexp = bypass_url_regexp
@app = app
@deflater = Rack::Deflater.new(@app)
@julik
julik / mute.applescript
Created November 17, 2014 13:26
Mute/unmute (for PowerMate, thanks to AJ)
-- http://blog.coolaj86.com/articles/how-to-control-os-x-system-volume-with-applescript/
set isMuted to output muted of (get volume settings)
if isMuted then
set volume without output muted
else
set volume with output muted
end if
@julik
julik / env.rb
Created November 19, 2014 21:51
# Make a little report :-)
added_keys = preserved.keys - ENV.keys
removed_keys = ENV.keys - preserved.keys
changed_keys = preserved.keys.select{|k| ENV.keys.include?(k) }.select{|k| preserved[k] != ENV[k] }
puts "Added to ENV and not removed #{added_keys.join(', ')}" if added_keys.any?
puts "Removed from ENV and not re-added #{removed_keys.join(', ')}" if removed_keys.any?
puts "Mutated in ENV and not reset #{changed_keys.join(', ')}" if changed_keys.any?
require 'uri'
module Julik
module AbsolutizeHelper
def canonicalize_hyperlinks(htmlcontent, root, host = nil, prot = nil)
htmlcontent.gsub(/(<(img|a)\b[^>]*(src|href)=)(["'])(.*?)\4/) do
md = $~
prefix = (host && prot) ? (prot + host) : ''
prefix.gsub!(/\/$/, '')
@julik
julik / travis_out.txt
Created December 12, 2014 11:14
Travis-CI output example
Using worker: worker-linux-10-1.bb.travis-ci.org:travis-linux-17
system_info
Build system information
Build language: ruby
Build image provisioning date and time
Sun Dec 7 06:19:19 UTC 2014
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04