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
| "\e[A":history-search-backward | |
| "\e[B":history-search-forward | |
| set completion-ignore-case on | |
| set show-all-if-ambiguous on |
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
| # muzang.rb | |
| require 'muzang' | |
| require 'muzang-plugins' | |
| class Bshellz | |
| include Muzang::Plugins::Helpers | |
| def initialize(bot) | |
| @bot = bot | |
| 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 'rest_client' | |
| require 'active_support/concern' | |
| require 'active_support/core_ext/string' | |
| module RspecApiDsl | |
| # This module is almost exact copy from this dsl: | |
| # https://raw.github.com/zipmark/rspec_api_documentation/master/lib/rspec_api_documentation/dsl.rb | |
| # | |
| # I didn't quike like Rails dependency and all that stuff | |
| # so I made few tweaks and attached RestClient. |
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 "spec_helper" | |
| resource "Errors" do | |
| get "/errors/:id" do | |
| parameter :id, "Error ID" | |
| let(:error) { OpenStruct.new(id: 1) } | |
| let(:id) { error.id } | |
| example "Get a single error" do |
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
| begin | |
| $raise = true | |
| raise RuntimeError if $raise | |
| puts "raise: #{$raise}" | |
| rescue RuntimeError | |
| $raise = false | |
| puts "in rescue, raise: #{$raise}" | |
| retry | |
| 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
| {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts, NoMonomorphismRestriction #-} | |
| -- config description | |
| -- | |
| import XMonad | |
| import XMonad.Config.Gnome | |
| import XMonad.Hooks.DynamicLog | |
| import XMonad.Hooks.ManageDocks | |
| import XMonad.Hooks.ManageHelpers | |
| import XMonad.Hooks.FadeInactive | |
| import XMonad.Hooks.EwmhDesktops (ewmh) |
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
| else if (strcmp(cmd, "FUCK") == 0 && n_args == 1) { | |
| client_output_printf(c, "+ FUCK: Go fuck yourself!\n"); | |
| c->state = CLIENT_DEAD; |
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
| ENV['RACK_ENV'] = 'test' | |
| require 'bundler/setup' | |
| require 'test/unit' | |
| gem 'minitest' | |
| require 'timecop' | |
| require 'grape' | |
| require 'logger' | |
| Grape::API.logger = Logger.new('/dev/null') |
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 'goliath' | |
| require 'grape' | |
| class OhSnap < Grape::API | |
| get :one do | |
| {"oh" => "bugger!"} | |
| end | |
| end | |
| class MyGrape < Goliath::API |
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 'goliath' | |
| require 'grape' | |
| class OhSnap < Grape::API | |
| version 'v1', using: :header, vendor: 'drug', format: :json | |
| get :one do | |
| {"oh" => "bugger!"} | |
| end | |
| end |