Skip to content

Instantly share code, notes, and snippets.

View mariusbutuc's full-sized avatar
🌏

Marius Butuc mariusbutuc

🌏
  • Toronto, ON
  • 22:47 (UTC -04:00)
View GitHub Profile
@mariusbutuc
mariusbutuc / modal-video-full.html
Created November 19, 2016 02:33 — forked from anam-hossain/modal-video-full.html
Full example - autoplay youtube video in a Modal (Bootstrap + Jquery)
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
$(function() {
$(".video").click(function () {
var theModal = $(this).data("target"),
videoSRC = $(this).attr("data-video"),
┃ Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
┃ /usr/local/Cellar/shopify-ruby/2.2.3-shopify_2/bin/ruby -r ./siteconf20160823-27222-1ml83gd.rb extconf.rb
┃ checking for libgda/sql-parser/gda-sql-parser.h... no
┃ libgda is missing. Try 'brew install libgda'
┃ *** 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.
@mariusbutuc
mariusbutuc / us_states.rb
Created June 16, 2016 18:13
Leverage Carmen to get US states
require 'carmen'
include Carmen
us = Country.named('United States’)
states = us.subregions.select { |subregion| subregion.type == 'state' }.map(&:name).sort
# => ["Alabama",
# "Alaska",
# "Arizona",
# "Arkansas",
# "California",
@mariusbutuc
mariusbutuc / git_branch_in_prompt.sh
Created June 7, 2016 18:42
git_branch_in_prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1
export PROMPT_COMMAND='__git_ps1 "\t \u@\h:\w" " \\\$ "'
export GIT_PS1_SHOWCOLORHINTS=1
source 'https://rubygems.org'
gem 'minitest'
gem 'pry-byebug'
@mariusbutuc
mariusbutuc / cache.rb
Last active April 29, 2016 20:57 — forked from nickhoffman/cache.rb
Code Kata #4: Cache
class Cache
attr_accessor :data
def initialize(data: {})
@data = data
end
def get(key)
return if data.fetch(key, {}).fetch(:expires_at, nil) <= now
@mariusbutuc
mariusbutuc / 3_mars_rover.rb
Last active April 22, 2016 22:31 — forked from nickhoffman/rover.rb
Mars Rover code kata
class Rover
class InvalidDirection < StandardError
def message
'Vertigoooooo!'
end
end
VALID_DIRECTIONS = %i(north south east west).freeze
attr_accessor :ns_coordinates, :ew_coordinates, :direction
@mariusbutuc
mariusbutuc / test_helper.rb
Last active March 14, 2016 14:27 — forked from arax/gist:4226541
VCR - ignore specific requests
# …
VCR.configure do |c|
c.hook_into :webmock
c.cassette_library_dir = 'spec/cassettes'
c.default_cassette_options = { :record => :new_episodes }
## Ignore some requests based on the hosts involved.
c.ignore_hosts 'localhost', '8.8.8.8', 'our.local.test.server.org'

Better condos.ca

  • download_slides: get the photos of the unit
  • essence: remove noise, while keeping only unit specific details
Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'