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
# Test group helpers for creating tables. | |
# The latest version can be gound at https://gist.github.com/lowjoel/bda0d44b48aac2925079 | |
module ActiveRecord::TemporaryTable; end | |
module ActiveRecord::TemporaryTable::TestGroupHelpers | |
# Defines a temporary table that is instantiated when needed, within a `with_temporary_table` | |
# block. | |
# | |
# @param [Symbol] table_name The name of the table to define. | |
# @param [Proc] proc The table definition, same as that of a block given to | |
# +ActiveRecord::Migration::create_table+ |
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
# frozen_string_literal: true | |
# Simultaneous code coverage reporting to Coveralls and Code Climate. | |
# Latest version can be found at https://gist.github.com/lowjoel/6c2f2d3a08bb3786994f | |
require 'simplecov' | |
module CoverageHelper | |
class << self | |
# Helper to include Coveralls/Code Climate coverage, but not require developers to install the | |
# gem. | |
# |
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
# This script is to work round the problem of broken RubyMine dependencies for bundle files. | |
# It uses an undocumented feature for RubyMine (but available in Intellij Idea) to create a | |
# gems library xml file and update the iml file. | |
# | |
# See Rubymine issues: | |
# https://youtrack.jetbrains.com/issue/RUBY-16428 | |
# https://youtrack.jetbrains.com/issue/RUBY-15026 | |
# https://youtrack.jetbrains.com/issue/RUBY-14542 | |
# | |
# Usage: |
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
import x10.io.Console; | |
public class MatrixMultiply { | |
private interface Matrix[T] { | |
public def initial(): T; | |
public def width(): Long; | |
public def widthRange(): LongRange; | |
public def height(): Long; | |
public def heightRange(): LongRange; | |
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
class Point | |
def initialize(x, y) | |
@x = x | |
@y = y | |
end | |
def to_s | |
"(#{@x}, #{@y})" | |
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
#!/usr/bin/python | |
# | |
# Copyright (c) 2009 Google Inc. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are | |
# met: | |
# | |
# * Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. |
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
require 'csv' | |
# Parses CSV-exported data from SleepBot | |
def parse_export(row) | |
# Parse the wake up date | |
date_to = row[0].split('/') | |
date_to = Time.new(2000 + date_to[2].to_i, date_to[1], date_to[0]) | |
# Parse the wake up/sleep times | |
time_from = row[1].split(':') |
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
#!/usr/bin/env ruby2.1 | |
# Modified from | |
# https://github.com/clintoncwolfe/chef-ci-tools/blob/master/bin/rubocop-junit-tee.rb | |
require 'fileutils' | |
# This first part runs Rubocop proper | |
puts "Executing within: #{Dir.pwd}" | |
RUBOCOP_XML = ARGV.shift | |
RUBOCOP_JSON = "#{RUBOCOP_XML}.json" | |
RUBOCOP = 'rubocop -R' |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'jshint' | |
require 'jshint/reporters' | |
reporter_name = ARGV[0] || :Default | |
file = ARGV[1] | |
linter = Jshint::Lint.new |
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
have_header: checking for ruby/thread.h... -------------------- yes | |
"cl -nologo -Feconftest -IC:/Ruby210/include/ruby-2.1.0/x64-mswin64_120 -IC:/Ruby210/include/ruby-2.1.0/ruby/backward -IC:/Ruby210/include/ruby-2.1.0 -I. -IC:/Ruby210/include/ruby-2.1.0 -MD -Zi -W2 -wd4996 -we4028 -we4142 /O2 /GL -Zm600 conftest.c x64-msvcr120-ruby210.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib iphlpapi.lib imagehlp.lib shlwapi.lib -link -incremental:no -debug -opt:ref -opt:icf -libpath:. -libpath:C:/Ruby210/lib " | |
conftest.c | |
Generating code | |
Finished generating code | |
checked program was: | |
/* begin */ | |
1: #include "ruby.h" | |
2: |
NewerOlder