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
| git remote prune origin | |
| git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin |
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
| module Jekyll | |
| class Document | |
| #Updated for Jekyll 3.0.0 | |
| # override post method in order to return categories names as slug | |
| # instead of strings | |
| # | |
| # An url for a post with category "category with space" will be in |
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
| # Like OpenStruct but doesn't let you read a non-assigned value (raises instead of returning nil). | |
| # This avoids issues where you read the wrong value due to a typo and don't notice. | |
| class HalfOpenStruct | |
| def initialize(hash = {}) | |
| @hash = hash | |
| end | |
| def include?(name) | |
| @hash.include?(name) |
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 'socket' | |
| require 'openssl' | |
| require 'puma/server' | |
| require 'ds9' | |
| class Server < DS9::Server | |
| def initialize socket, app | |
| @app = app | |
| @read_streams = {} | |
| @write_streams = {} |
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: node_js | |
| node_js: | |
| - '0.10' | |
| - '0.11' | |
| - '0.12' | |
| - 'iojs-v1.7.1' | |
| matrix: | |
| allow_failures: |
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
| module ImagesHelper | |
| # Example usage: | |
| # | |
| # image_set_tag_3x "foo_1x.png", alt: "foo" | |
| # | |
| # Will assume there is a 2x and 3x version and provide those automagically. | |
| # | |
| # Based on https://gist.github.com/mrreynolds/4fc71c8d09646567111f | |
| def image_set_tag_3x(source, options = {}) | |
| srcset = [ 2, 3 ].map { |num| |
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
| upstream gitlab { | |
| server 172.17.42.1:10080 fail_timeout=0; | |
| } | |
| # let gitlab deal with the redirection | |
| server { | |
| listen 80; | |
| server_name git.example.com; | |
| server_tokens off; | |
| root /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 'spec_helper' | |
| require 'rake' | |
| RSpec.describe Api::V1::PostsController, :vcr, record: :new_episodes, :type => :api do | |
| context "elastic search test", elasticsearch: true, commit: true do | |
| before do | |
| @post = FactoryGirl.create(:post, first_name: "August", last_name: "Rush", email: "[email protected]", event: "Rock Concert") | |
| 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
| RSpec.configure do |config| | |
| #config.before(:suite) do | |
| # DatabaseCleaner.clean_with(:truncation) | |
| #end | |
| #config.before(:each) do | |
| # DatabaseCleaner.strategy = :transaction | |
| #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
| # This file was generated by the `rails generate rspec:install` command. Conventionally, all | |
| # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
| # The generated `.rspec` file contains `--require spec_helper` which will cause this | |
| # file to always be loaded, without a need to explicitly require it in any files. | |
| # | |
| # Given that it is always loaded, you are encouraged to keep this file as | |
| # light-weight as possible. Requiring heavyweight dependencies from this file | |
| # will add to the boot time of your test suite on EVERY test run, even for an | |
| # individual file that may not need all of that loaded. Instead, make a | |
| # separate helper file that requires this one and then use it only in the specs |