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 is a hack to just simplify variable namings, because they're ugly, for easier debugging | |
const HarmonyImportDependency = require('webpack/lib/dependencies/HarmonyImportDependency'); | |
const HarmonyImportSpecifierDependency = require('webpack/lib/dependencies/HarmonyImportSpecifierDependency'); | |
const HarmonyImportSpecifierDependencyTemplate = HarmonyImportSpecifierDependency.Template; | |
const path = require('path'); | |
const HIDproto = HarmonyImportDependency.prototype; | |
const HISDTproto = HarmonyImportSpecifierDependencyTemplate.prototype; | |
const originalGetImportVar = HIDproto.getImportVar; |
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 C | |
def content_for(smth, content) | |
if smth == 'smth' | |
m do | |
p "smth #{content}" | |
end | |
elsif smth == 'smth2' | |
m do | |
p "smth2 #{content}" | |
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
require 'timers' | |
module Celluloid | |
# Don't do Actor-like things outside Actor scope | |
class NotActorError < Celluloid::Error; end | |
# Trying to do something to a dead actor | |
class DeadActorError < Celluloid::Error; end | |
# A timeout occured before the given request could complete |
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 'celluloid' | |
class C | |
include Celluloid | |
def wait(c) | |
if c.attr >= 200 | |
puts "c.attr >= 200" | |
return "finished" | |
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
require 'mongoid' | |
Mongoid::Config.instance.from_hash({"database" => "oid"}) | |
class Tweeter | |
include Mongoid::Document | |
field :user | |
embeds_many :tweets | |
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
source :rubygems | |
gem 'pry' | |
gem 'capybara' | |
gem 'capybara-webkit' | |
gem 'celluloid' |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
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 'base64' | |
require 'socket' | |
require 'fileutils' | |
# UnixSocketForker is an experiment of inter-process communication using | |
# plain unix sockets to communicate between forked processes and the | |
# parent process. This can also be done via IO.pipe. In this experiment, | |
# the jobs are simply random arrays whose sums are calculated in the forked | |
# worker processes. | |
class UnixSocketForker |
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
RSpec::Matchers.define :have_widget_elements_for do |widget| | |
match do |actual| | |
puts actual.to_yaml | |
@errors = {} | |
expected_elements = { | |
:widget => ".widget", | |
:content_type => ".#{widget.content_type}", | |
:body => ".body", | |
:title => ".title", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Instant Google Custom Search Engine (CSE)</title> | |
<meta charset="utf-8"> | |
<meta name="description" content="Google Custom Instant"> | |
<link href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css"> | |
<link rel="stylesheet" href="html5reset.css" type="text/css" media="screen"> | |
<link rel="stylesheet" href="style.css" type="text/css" media="screen"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |
NewerOlder