Skip to content

Instantly share code, notes, and snippets.

View blambeau's full-sized avatar

Bernard Lambeau blambeau

View GitHub Profile
@blambeau
blambeau / Gemfile
Created January 13, 2012 13:54
Temple uninitialized constant Temple::Mixins::CompiledDispatcher
source :rubygems
gem "temple"
@blambeau
blambeau / gist:1612013
Created January 14, 2012 16:51
epath test failures under mingw
Run options: exclude {:fails_on=>#<Proc:./spec/spec_helper.rb:32>, :unix=>false, :symlink=>false, :ruby=>#<Proc:./spec/spec_helper.rb:27>}
........FF...........................F.F.....F..FF...........F.....F......F...............................................
Failures:
1) Path implementation realpath
Failure/Error: not_exist.make_symlink('not-exist-target')
NotImplementedError:
symlink() function is unimplemented on this machine
# ./lib/epath/file.rb:65:in `symlink'
@blambeau
blambeau / gist:2960784
Created June 20, 2012 16:28
Path coercible
def source_text(arg)
case arg
when IO then arg.read
when Path then Path(arg).read
else
raise "Unable to find source text for `#{arg}`"
end
end
describe 'with an array with non bytes', ->
arg = [2, 4, -12]
subject =
try
type.dress(arg)
catch e
e
it 'should raise an error', ->
TypeError: Cannot read property 'should' of undefined
at World.<anonymous> (/Users/blambeau/work/devel/qjs/features/step_definitions/steps.coffee:59:12)
at Object.invoke (/usr/local/lib/node_modules/cucumber/lib/cucumber/support_code/step_definition.js:84:14)
at Object.execute (/usr/local/lib/node_modules/cucumber/lib/cucumber/ast/step.js:161:22)
at Object.acceptVisitor (/usr/local/lib/node_modules/cucumber/lib/cucumber/ast/step.js:153:12)
at Object.executeStep (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:192:12)
at Object.processStep (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:187:14)
at /usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:80:16
at callUserFunctionAndBroadcastAfterEvent (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:104:9)
at iterate (/usr/local/lib/node_modules/cucumber/lib/cucumber/type/collection.js:31:11)
@blambeau
blambeau / ast.rb
Created March 9, 2014 18:20
Q -- Abstract Syntax Tree
[
:system,
[
:type_def,
"Boolean",
[
:union_type,
[
:builtin_type,
"TrueClass"
@blambeau
blambeau / gist:366bd21ff9704c33b9b1
Created May 20, 2014 17:19
Finitio dress/undress
S = Finitio.parse <<-EOF
Uuid = String( ... )
Time = .Date <iso> String( s | ... ) .Finitio.Contract.Time.iso
Physical = {
uuid: String
title: String
at: String
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.8/angular.js"></script>
<script>
var myApp = angular.module('myApp', [
]);
myApp.directive('bang', function() {
return {
link: function(scope, element, attr) {
logger.configure({
default: "none",
override: {
"brolMachin": "all",
"trucBidule": "get"
}
});
customResource.get("brolMachin").then(function(result){
//
@blambeau
blambeau / gist:03e9c8239ce9818a45a8
Last active August 29, 2015 14:11
PostgreSQL and CTEs

Why doesn't PostgreSQL optimize Common Table Expressions?

PostgreSQL does not seem to optimize common table expressions (CTE) very well. At the same time, is seems to optimize properly when views are involved. Any idea why? Is that accidental or is it a technical/theoretical/essential reason? Examples below.

With CTE, restriction after join

Does not seem optimized.

sap=# explain with j as (select * from suppliers natural join shipments) select * from j where status > 20;