View fib.rb
#!/usr/bin/env ruby | |
def fib0(a) | |
0.upto(a.size-1) { |i| a[i] += 1 } | |
end | |
def fib1(a) | |
fib0(a) | |
end |
View Results
Safari 47.5 | |
Chrome 40.6 | |
Firefox 8.9 | |
AppleMail 2.6 | |
Other 0.3 | |
PhantomJS 0.0 | |
Camino 0.0 | |
WebKit Nightly 0.0 |
View brewfoster
#!/usr/bin/env ruby | |
require 'pathname' | |
require 'set' | |
require 'pp' | |
def dependencies | |
deps = {} | |
IO.popen(['brew', 'deps', '--installed']) do |f| | |
f.each do |line| | |
md = /^([^:]+):\s*(.*)$/.match(line) or raise "Can't parse dependencies" |
View dry_run.php
<?php | |
use Drupal\migrate_plus\Event\MigrateEvents as MigratePlusEvents; | |
use Drupal\migrate_plus\Event\MigratePrepareRowEvent; | |
use Drupal\migrate\Plugin\MigrateIdMapInterface; | |
function dry_run_migration($migration_id) { | |
// Get the migration source. | |
$migrationManager = \Drupal::service('plugin.manager.config_entity_migration'); | |
$migration = $migrationManager->createInstance($migration_id); |
View uuid.php
<?php | |
use Symfony\Component\Yaml\Yaml; | |
global $config_directories; | |
$config_name = drush_shift(); | |
if (!isset($config_directories[$config_name])) { | |
print "No such config directory $config_name\n"; | |
exit; | |
} |
View toggl2rm.rb
#!/usr/bin/ruby | |
require 'date' | |
require 'json' | |
require 'net/http' | |
require 'openssl' | |
require 'optparse' | |
require 'ostruct' | |
require 'pp' | |
def req(url, method = :Get) |
View mdns.pl
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use IO::Select; | |
use IO::Socket::INET; | |
# Build an mDNS query. | |
sub build_query { | |
my $domain = shift; |
View test.rs
use std::rc::Rc; | |
use std::cell::RefCell; | |
use std::ops::DerefMut; | |
struct A<'a> { | |
pub v: Vec<Rc<RefCell<FnMut() + 'a>>>, | |
} | |
impl<'a> A<'a> { | |
pub fn add3<F: FnMut() + 'a>(&mut self, f: F) { | |
let r = Rc::new(RefCell::new(f)); |
View mh.php
<?php | |
// Helper for executing migrations in D8, without migrate_tools. | |
$args = drush_get_arguments(); | |
array_splice($args, 0, 2); | |
$cmd = array_shift($args); | |
switch ($cmd) { | |
case 'mi': |
View migrate.migration.shows.yml
id: shows | |
migration_tags: { } | |
label: 'TV shows' | |
source: | |
plugin: json_source | |
path: 'http://api.tvmaze.com/search/shows?q=family' | |
identifier: id | |
identifierDepth: 1 | |
headers: { } | |
fields: { } |
NewerOlder