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 CharClassData | |
def initialize(char_classes) | |
@switch_points = [] | |
@result_ccs = [] | |
prev_cc = nil | |
max_ch = char_classes.flatten.max + 1 | |
(0..max_ch).each do |ch| | |
next if prev_cc && char_classes[prev_cc].include?(ch) | |
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 work is dedicated to the public domain or, in any case where copyright may not be relinquished, offered under an MIT License | |
def _falsey_on_empty(iterable: Iterable[T]) -> Iterable[T]: | |
"""Return an iterable that is falsey if empty, but always yields the same elements | |
:returns: | |
``()`` if *iterable* is empty, otherwise an iterable over the same | |
values | |
Iterable values cannot be generally relied on to return ``False`` when |
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
( echo '--- |'; uptime; sensors; echo '--- |'; ps axjf ) | tee hw-report.txt |
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 'psych' | |
# Construct one of these, use #find_problem!; if not nil, then use #apply_fix and repeat | |
class ScalarLiteralTester | |
class MethodInvocation | |
def initialize(name, args, block) | |
@name = name | |
@args = args | |
@block = block | |
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
The Oro Programming Language (commit 537b5df): sha256 211667824c1f60b1c9353c1dcea666cefb7786da3c834ab1db680d19176884c5 | |
The Cadmus compiler: sha1 f6e4d6ebdca5cd03adc590f7ebb25b0e92c678a8 | |
xscreensaver: sha1 b2ce7b8a96752a5eae88d2a4dba7df2ffd81dc2f |
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
@echo off | |
echo Adding Ruby and 7-Zip to PATH... | |
set PATH=%PATH%;C:\Ruby22-x64\bin;C:\Program Files\7-Zip | |
echo Setting up Visual Studio 12.0 (2013) Command Prompt... | |
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat" | |
echo Changing to user home directory... | |
%HOMEDRIVE% |
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
-- Everything You Ever Wanted to Know About the Structure (returned as XML) | |
SET NOCOUNT ON; | |
DECLARE @VersionString AS NVARCHAR(100); | |
DECLARE @ver AS tinyint; | |
SET @VersionString = CAST(SERVERPROPERTY('productversion') AS NVARCHAR(100)); | |
SET @ver = CAST(LEFT(@VersionString, CHARINDEX(N'.', @VersionString) - 1) AS tinyint); | |
DECLARE @EventGroups AS 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
#!/usr/bin/env ruby | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Richard T. Weeks | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |