This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place this file in your plugins directory and add the tag to your sidebar | |
#$ cat source/_includes/custom/asides/categories.html | |
#<section> | |
# <h1>Categories</h1> | |
# <ul id="categories"> | |
# {% category_list %} | |
# </ul> | |
#</section> | |
module Jekyll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- pomodoro timer widget | |
pomodoro = {} | |
-- tweak these values in seconds to your liking | |
pomodoro.pause_duration = 300 | |
pomodoro.work_duration = 1200 | |
pomodoro.pause_title = "Pause finished." | |
pomodoro.pause_text = "Get back to work!" | |
pomodoro.work_title = "Pomodoro finished." | |
pomodoro.work_text = "Time for a pause!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: storeconfigs | |
Scenario: export resource | |
Given a node of class "exporting" | |
When I compile its catalog | |
Then it should export a resource "File[foo]" | |
Scenario: collect resource | |
Given a node of class "collecting" | |
And an exported resource "File[bar]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in Rails | |
class BarCollection | |
def initialize | |
@bars = [Bar.new, Bar.new] | |
end | |
def get_bars | |
@bars | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo: &foo | |
adapter: <%= ENV['TDDIUM_DB_ADAPTER'] %> | |
database: <%= ENV['TDDIUM_DB_NAME'] %> | |
username: <%= ENV['TDDIUM_DB_USER'] %> | |
password: <%= ENV['TDDIUM_DB_PASSWORD'] %> | |
<%= "socket: #{ENV['TDDIUM_DB_SOCKET']}" if ENV['TDDIUM_DB_SOCKET'] %> | |
development: &development | |
adapter: <%= ENV['TDDIUM_DB_ADAPTER'] %> | |
database: <%= ENV['TDDIUM_DB_NAME'] %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe "sample_app::_group" | |
include_recipe "sample_app::_user" | |
include_recipe "apt::add_company_repository" | |
include_recipe "sample_app::_server_install_from_package" | |
include_recipe "sample_app::_server_runit" | |
include_recipe "sample_app::_server_config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PrimeFactors | |
def decompose(number) | |
if number <= 3 | |
[number] | |
else | |
prime_factors = [] | |
(2..number / 2).each do |prime| | |
while(number % prime).zero? do | |
number = number / prime | |
prime_factors << prime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# uses exception-throwing !-methods in lower level code to communicate errors | |
class ApiController < ApplicationController | |
def update | |
publisher = PublishingService.new | |
publisher.update(params[:article], params[:author]) | |
render_success | |
rescue => e | |
render_failure("Failed to publish article: #{e.message}") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
driver_plugin: vagrant | |
provisioner: chef_zero | |
driver_config: | |
require_chef_omnibus: 11.6.0 | |
http_proxy: http://10.0.3.1:8123 | |
https_proxy: https://10.0.3.1:8123 | |
provider: lxc | |
platforms: |