Skip to content

Instantly share code, notes, and snippets.

View prdetective's full-sized avatar

Vladimir Krivchenko prdetective

View GitHub Profile
@prdetective
prdetective / gist:de013dc24f84d188cd4e
Created August 27, 2015 14:05
Start/stop local FTP server on OS X
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
@prdetective
prdetective / Error
Last active August 29, 2015 14:21 — forked from roolo/Error
Can't install RMagick 2.12.2. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
@prdetective
prdetective / Yard doc template
Created April 7, 2014 14:11
Yard doc template
# Делает очень важные вещи
# @param parameter [String] важная строчка
# @note Комментарий (вызывает при нажатии на...)
# @example
# method('str')
# @return [Boolean] удалось ли сделать важные вещи
# @see ClassRef
def method
end
class SinatraApp < Sinatra::BASE
get '/send' do
halt 500, 'Wrong parameters' if params['url'].nil? or params['url'].empty?
RequestSender.send(params['url'])
'OK'
end
h = {}
"url=http://ya.ru&param=12345".split('&').each do |pair|
k,v = pair.split('=')
h[k] = v
end
{:y => 20}.map{|k, v| "#{k} = #{v}"}.join(',')+", x = 10"
class Original
def self.some_method
# something original...
end
end
module Override
def self.included base
base.instance_eval do
def some_method