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
puts 'Hello, World!' |
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
const Module = require('module') | |
Module._resolveLookupPaths = new Proxy(Module._resolveLookupPaths, { | |
apply(target, self, args) { | |
console.dir(args[1].paths) | |
return target.apply(self, args) | |
} | |
}) | |
require('name-of-module') |
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
const fs = require('fs') | |
const gs = require('glob-stream') | |
const File = require('vinyl') | |
const { Transform } = require('stream') | |
const map = (transform) => new Transform({ objectMode: true, transform }) | |
const ospath = require('path') | |
//const isUTF8 = require('is-utf8') | |
const { pipeline } = require('stream') | |
function smartStat (path_, callback) { |
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 'asciidoctor-pdf' | |
require 'java' | |
java_import 'java.util.concurrent.Callable' | |
java_import 'java.util.concurrent.FutureTask' | |
java_import 'java.util.concurrent.LinkedBlockingQueue' | |
java_import 'java.util.concurrent.ThreadPoolExecutor' | |
java_import 'java.util.concurrent.TimeUnit' | |
class App | |
include Callable |
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 File | |
class << self | |
def absolute_path? path | |
(path.start_with? '/') || (ALT_SEPARATOR && (path.start_with? (absolute_path path).slice 0, 3)) | |
end unless method_defined? :absolute_path? | |
end | |
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/bash | |
# GEM_VERSION=1.5.0.alpha.10 NEXT_GEM_VERSION=1.5.0.alpha.11.dev ./cut-release.sh -p | |
PUSH=false | |
while getopts "p" option; do | |
case $option in | |
p) PUSH=true ;; | |
esac | |
done |
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 RougeSyntaxHighlighter < Asciidoctor::SyntaxHighlighter::Base | |
register_for 'rouge' | |
def initialize *args | |
super | |
@requires_stylesheet = nil | |
@style = nil | |
end | |
def highlight? |
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 PrismSyntaxHighlighter < Asciidoctor::SyntaxHighlighter::Base | |
register_for 'prism' | |
def format node, lang, opts | |
opts[:transform] = proc do |pre, code| | |
if node.attr? 'linenums', nil, false | |
pre['class'] += ' line-numbers' | |
if (start = node.attr 'start', nil, false) | |
pre['data-start'] = start | |
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
# serve multiple clients at once | |
require 'socket' | |
require 'net/http' | |
server = TCPServer.new 4040 | |
server_thread = Thread.start do | |
loop do | |
Thread.start server.accept do |socket| | |
/^GET (\S+) HTTP\/1\.1$/ =~ socket.gets.chomp | |
path = $1 |
NewerOlder