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 "benchmark" | |
range = 1...1000000 | |
n = 100 | |
Benchmark.bmbm do |b| | |
b.report "r.entries.last" do | |
n.times do | |
f = range.entries.last | |
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
Sentence offset=0, "...ange (weather|time))": | |
Literal offset=0, "maybe ": | |
SyntaxNode offset=0, "m" | |
SyntaxNode offset=1, "a" | |
SyntaxNode offset=2, "y" | |
SyntaxNode offset=3, "b" | |
SyntaxNode offset=4, "e" | |
SyntaxNode offset=5, " " | |
Parenthesised+Parenthesised0 offset=6, "(this is|that was)": | |
SyntaxNode offset=6, "(" |
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
<html> | |
<head> | |
<style> | |
.container { | |
font-family: Helvetica; | |
font-size: 1.5em; | |
} | |
.transform { | |
-webkit-perspective: 150px; |
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 "active_support/core_ext" | |
def build_json(n) | |
struct = Struct.new(:name, :birthyear, :bio, :url) | |
author = struct.new("Rolf", 1920, "Software developer", "http://example.com/") | |
author.instance_eval { undef each } # Jbuilder doesn't like #each on non-arrays. | |
now = Time.now | |
arr = 100.times.to_a | |
n.times do | |
json = Jbuilder.encode do |json| |
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
#target photoshop | |
/* Open the given file, and compress with TinyPNG. */ | |
function compressFile(file) { | |
var document = open(file); | |
if (document.mode == DocumentMode.INDEXEDCOLOR) { | |
document.changeMode(ChangeMode.RGB); | |
} |
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 zmq = require("./lib") | |
const client = zmq.socket("dealer") | |
client.connect("tcp://127.0.0.1:3456") | |
gc() | |
console.log(process.memoryUsage()) | |
for (let i = 0; i < 500; i++) { |
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
'use strict'; | |
const buildType = process.config.target_defaults.default_configuration; | |
const assert = require('assert'); | |
const common = require('./common'); | |
// we only check async hooks on 8.x an higher were | |
// they are closer to working properly | |
const nodeVersion = process.versions.node.split('.')[0] | |
let async_hooks = undefined; | |
function checkAsyncHooks() { |