Skip to content

Instantly share code, notes, and snippets.

View dimianstudio's full-sized avatar
🇺🇦
Слава Україні!

Dmytro Myrhorodskyi dimianstudio

🇺🇦
Слава Україні!
View GitHub Profile
module Fetcher
module Base
class Processor
attr_reader :source
def initialize(source)
@source = source
@problems = []
end
@dimianstudio
dimianstudio / gist:8869583
Last active August 29, 2015 13:56
Updating Virtual Box Guest Additions

The packaged vagrant box from Ubuntu contains outdated Virtual Box Guest Additions. Most of the time this shouldn't be a problem, but if you want to update them I recommend this procedure:

  1. Install the vagrant-vbguest plugin: vagrant plugin install vagrant-vbguest
  2. Boot the vm without provisioning: vagrant up --no-provision
  3. Login with vagrant ssh and run sudo apt-get -y -q purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
  4. Logout and vagrant halt
  5. vagrant up --provision

https://github.com/TryGhost/Ghost-Vagrant#updating-virtual-box-guest-additions

# set your user tokens as enivornment variables, such as ~/.secrets
# See the README for examples.
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
bunzip2 < my_database.sql.bz2 | mysql -h localhost -u root -p my_database
@dimianstudio
dimianstudio / notes.md
Created August 6, 2012 05:46 — forked from searls/notes.md
Stack traces I get when I attempt to install native Ruby extensions on OS X 10.8 Mountain Lion Developer Preview

Trying to make my Ruby environment happy under OS X 10.8 Mountain Lion

A few notes. I had:

  • installed XCode 2.4 Preview as well as its command line tools (which are found separately in Preferences -> Downloads)
  • updated rvm (rvm get latest)

and my issue was:

  • system ruby installed every gem with native extensions I threw at it
// jquery invert plugin
// by paul irish
// some (bad) code from this css color inverter
// http://plugins.jquery.com/project/invert-color
// some better code via Opera to inverse images via canvas
// http://dev.opera.com/articles/view/html-5-canvas-the-basics/#insertingimages
// and some imagesLoaded stuff from me
// http://gist.github.com/268257
@dimianstudio
dimianstudio / gist:874306
Created March 17, 2011 13:31
simple_form && ancestry && grouped_colection_select
.input.required
= f.label :rate_plan_id
= f.grouped_collection_select :rate_plan_id, RatePlan.roots, :children, :name, :id, :name, {:include_blank => true}
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
$.ajaxSetup({
headers: {
"X-CSRF-Token": $("meta[name='csrf-token']").attr('content')
}
});