This file contains hidden or 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
| public interface IIssueDataFetcher | |
| { | |
| void Fetch(Action<IssueData> callback); | |
| IIssueDataFetcher WithId(int id); | |
| IIssueDataFetcher IncludeContainers(); | |
| IIssueDataFetcher IncludeContainerStatuses(); | |
| IIssueDataFetcher IncludeContainerCategories(); | |
| IIssueDataFetcher IncludeAll(); | |
| } |
This file contains hidden or 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
| def guard(a, b, c) | |
| if a < 0 || b < 0 || c < 0 | |
| raise TriangleError, "a triangle should not have a side with a negative value." | |
| end | |
| if a == 0 && b == 0 && c == 0 | |
| raise TriangleError, "A triangle should not have all its side equal to 0." | |
| end | |
| if (a + b) <= c || (b + c) <= a || (a + c) <= b | |
| raise TriangleError, "Any two sides of a triangle should add up to more than the third side." | |
| end |
This file contains hidden or 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
| require File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
| def triple?(dice, val) | |
| dice.count {|die| die == val} >= 3 | |
| end | |
| def get_triple_bonus(dice) | |
| return 0 if dice.empty? | |
| return 350 if triple? dice, 5 | |
| return 700 if triple? dice, 1 |
This file contains hidden or 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
| public class TestBase | |
| { | |
| private Exception _exception; | |
| [TestInitialize] | |
| public void TestInitialize() | |
| { | |
| try | |
| { | |
| Initialize(); |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| using System.Windows; | |
| using System.Windows.Input; | |
| using PagePlanner.Windows.Controls.TriggerActions; | |
| namespace PagePlanner.Windows.Controls.Behaviours.KeyGestures | |
| { |
This file contains hidden or 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
| require "sinatra" | |
| require "mogli" | |
| enable :sessions | |
| set :raise_errors, false | |
| set :show_exceptions, false | |
| # Scope defines what permissions that we are asking the user to grant. | |
| # In this example, we are asking for the ability to publish stories | |
| # about using the app, access to what the user likes, and to be able |
This file contains hidden or 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
| Factory.sequence :writer_hash do |n| | |
| { | |
| "id" => "#{n}", | |
| "name" => "name#{n}", | |
| "article" => { | |
| "id" => "#{n}", | |
| "title" => "post title #{n}" | |
| } | |
| } | |
| end |
This file contains hidden or 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
| function get-path{ | |
| $env:path -split';' | |
| } | |
| function whereis | |
| { | |
| $argument = $cmd, [string]$arguments = $args; | |
| foreach ($item in get-path){ | |
| foreach ($thing in gci $item -ErrorAction silentlycontinue){ | |
| if($thing.Name.StartsWith($cmd + ".")){ |
This file contains hidden or 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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or 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
| #!/bin/sh | |
| # Credits goes to http://stackoverflow.com/questions/1589114/opening-a-new-terminal-tab-in-osxsnow-leopard-with-the-opening-terminal-window#answer-7911097 | |
| # I just slightly modified it to take an argument. | |
| new_tab() { | |
| pwd=`pwd` | |
| osascript -e "tell application \"Terminal\"" \ | |
| -e "tell application \"System Events\" to keystroke \"t\" using {command down}" \ | |
| -e "do script \"cd $pwd; clear; $1;\" in front window" \ |
OlderNewer