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/ruby | |
# search for unmatched '{' / '}' pairs and '#ifndef' / '#endif' pairs | |
# assuming that any given file should have fully matched sets of both | |
Dir.glob("src/**/*\.[h,cpp]").each { |src| | |
c = File.read(src) | |
ob = c.count('{') | |
cb = c.count('}') | |
od = c.count('#ifndef') | |
cd = c.count('#endif') |
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
# LVM Parser & Block Reader | |
# | |
# Copyright (C) 2016 Red Hat Inc | |
require 'optparse' | |
require 'ostruct' | |
require 'binary_struct' | |
### constants |
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/ruby | |
# Read / write db related metadata to/from dia diagram | |
# | |
# Copyright (C) 2015-2016 - Red Hat Inc. | |
require 'zlib' | |
require 'nokogiri' | |
require 'optparse' | |
require 'active_record' | |
require 'active_support/core_ext/string' |
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
//// Bitcoin Barber Shop Pole | |
//// Author: Mo Morsi <mo@morsi.org> | |
//// Arduino Controller Sketch | |
//// | |
//// License: MIT | |
//// For use at the Syracuse Innovators Guild (sig315.org) | |
#include <SPI.h> | |
#include <Ethernet.h> |
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
# FSoup - filesystem soup | |
# Disk and File System Factory | |
# | |
# Licensed under the MIT license | |
# Copyright (C) 2014 Red Hat Inc. | |
$include_factories = true | |
module FSoup | |
module Util |
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/ruby | |
# ReFS File Lister | |
# Copyright (C) 2014 Red Hat Inc. | |
require 'optparse' | |
require 'colored' | |
FIRST_PAGE_ID = 0x1e | |
PAGE_SIZE = 0x4000 | |
FIRST_PAGE_ADDRESS = FIRST_PAGE_ID * PAGE_SIZE |
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/ruby | |
# resilience.rb - Ruby ReFS Parser | |
# Copyright (C) 2014 Red Hat Inc. | |
require 'optparse' | |
require 'colored' | |
FIRST_PAGE_ID = 0x1e | |
PAGE_SIZE = 0x4000 |
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
134a135,188 | |
> /** | |
> * Create a new THREE.Vector3 instance and project it onto a random point | |
> * on a spiral (in the XY-plane) centered at `base` and with randomized radius. | |
> * | |
> * Spiral generated by rotating series of ellipses generated with the | |
> * specified skew in accordance with the density wave theory | |
> * | |
> * @param {THREE.Vector3} base | |
> * @param {Number} radius |
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 'json' | |
class Class | |
class << self | |
attr_accessor :permitted_json_classes | |
end | |
def permit_json_create | |
Class.permitted_json_classes ||= [] | |
unless Class.permitted_json_classes.include?(self.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
require 'json' | |
module JSON | |
class << self | |
def deep_const_get(path) | |
path.to_s.split(/::/).inject(Object) do |p, c| | |
case | |
when c.empty? then p | |
when p.constants.collect { |c| c.to_s }.include?(c) | |
then p.const_get(c) |