Skip to content

Instantly share code, notes, and snippets.

View mpapis's full-sized avatar
🙃
I am slow to respond, ping me when it's crucial.

Michal Papis mpapis

🙃
I am slow to respond, ping me when it's crucial.
View GitHub Profile
@mpapis
mpapis / bad.rb
Last active January 1, 2016 22:49
I hate asymmetrical code
apply_event :transfer_sent, :target_account_uid => target,
:amount => amount,
:new_balance => new_balance.amount,
:account_uid => uid
require "rvm/with"
Bundler.with_clean_env do
RVM.with "in ." do |r|
puts r.execute "bundle install"
puts r.execute "rake db:create db:migrate db:setup"
end
end
@mpapis
mpapis / osx_109_install_clt.sh
Last active December 27, 2015 21:29
Install CLT if not yet installed, for OSX 10.9+
osx_109_install_clt()
{
typeset __developer_update
# continue if already using some xcode
xcode-select -p >/dev/null 2>&1 && return 0 || true
# trick the update to think user opened the dialog
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
# find pending update
__developer_update="$(
softwareupdate -l 2>/dev/null |
@mpapis
mpapis / sudoers
Last active December 26, 2015 20:09 — forked from anonymous/output
nick ALL=NOPASSWD:/sbin/start foo,/sbin/stop foo,/sbin restart foo,/sbin/service foo start,/sbin/service foo stop,/sbin/service foo restart,/home/nick/.rvm/wrappers/foo/foreman
@mpapis
mpapis / deploy.rb
Last active December 26, 2015 17:29 — forked from anonymous/deploy.rb
require "rvm1/capistrano3"
after 'deploy:updating', 'deploy:bundle_install'
namespace :deploy do
task :bundle_install do
on roles(:app) do
within release_path do
execute :bundle, "install --quiet --system --without [:test, :development]"
end
end
--- branches/ruby_2_0_0/ChangeLog 2013/07/06 16:58:40 41811
+++ branches/ruby_2_0_0/ChangeLog 2013/07/06 17:05:08 41812
@@ -1,3 +1,20 @@
+Sun Jul 7 02:00:41 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
+
+ * lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
+ critical.
+ The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
+ the certificate that has critical SAN value. X509 extension could
+ include 2 or 3 elements in it:
@mpapis
mpapis / gist:6845898
Last active December 24, 2015 18:49 — forked from headius/gist:6837592
[2013-10-05 01:53:57] env
current path: /Users/headius/.rvm/src/rbx-2.0.0
command(8): env /Users/headius/.rvm/wrappers/ruby-2.0.0-p247@rubinius/ruby ./configure --prefix=/Users/headius/.rvm/rubies/rbx-2.0.0 --with-opt-dir=/usr/local/opt/libyaml --with-opt-dir=/usr/local/opt/readline --with-opt-dir=/usr/local/opt/libksba --with-opt-dir=/usr/local/opt/openssl
Checking gcc: found
Checking g++: found
Checking bison: found
Configuring LLVM...
Checking for existing LLVM library tree: not found.
Checking for 'llvm-config': not found
Checking for prebuilt LLVM package...
#!/bin/sh
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Get Xcode CLI tools
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
TOOLS=clitools.dmg
if [ "$OSX_VERS" -eq 7 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
elif [ "$OSX_VERS" -eq 8 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
@mpapis
mpapis / config.ru
Last active December 23, 2015 13:39
require 'rubygems'
require 'bundler'
require 'bundler-unload'
ALL_GEMS = Bundler.rubygems.plain_specs
Bundler.require :default
require 'sinatra'
require 'yaml'
require 'multi_json'
RAILS_ROOT=/home/deployer/apps/arcsite/current
UNICORN=/home/deployer/.rvm/wrappers/arcsite/unicorn