Skip to content

Instantly share code, notes, and snippets.

View bb's full-sized avatar

Benjamin Bock bb

  • Leipzig, Germany
View GitHub Profile
@bb
bb / pyproject.toml
Created May 13, 2020 13:37
reproduction for python poetry issue
[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Benjamin Bock"]
[tool.poetry.dependencies]
python = "^3.8"
django = "^3.0.6"
django-fsm = "^2.7.0"
@bb
bb / index.js
Created January 19, 2018 22:59
SSR vs Client State: flicker or fail?
// this is pages/index.js of a fresh next.js app
import {observer} from 'mobx-react';
import {observable} from 'mobx';
const store = observable({ color: "#f00"})
const clientOnly = () => store.color = "#0f0";
if (typeof window != 'undefined') {
// clientOnly(); // too early: stays red + console error
// Promise.resolve().then(clientOnly); // too early: stays red + console error
<!DOCTYPE html>
<html>
<body>
<form id="select_multiple_values">
<fieldset>
<label>Example one: Select many from many:</label><br>
<select multiple="multiple" data-bind="options: list2, optionsText: 'name', selectedOptions: selected2"></select>
<ul data-bind="foreach: selected2">
<li><span data-bind="text: name"></span> is on <span data-bind="text: host"></span></li>
</ul>
# In a fresh Rails 3 project, running ruby-1.9.2-p180,
# the mail_to helper doesn't work with umlauts and encode-argument.
➜ ruby-192-rails-3-enc-test ○ rails c
Loading development environment (Rails 3.0.7)
ruby-1.9.2-p180 :001 > helper.mail_to "ä", "ä", :encode => :hex
Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/tag_helper.rb:114:in `content_tag_string'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/tag_helper.rb:79:in `content_tag'
from /Users/bb/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.7/lib/action_view/helpers/url_helper.rb:512:in `mail_to'
@bb
bb / application.html.erb
Created March 3, 2011 20:59
Rails 3 Routing and URL generation challenge
<!DOCTYPE html>
<html>
<head>
<title>Urltest --- see routes.rb for details</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
diff --git a/templates/default/module/html/box_info.erb b/templates/default/module/html/box_info.erb
index e436984..49a0b48 100644
--- a/templates/default/module/html/box_info.erb
+++ b/templates/default/module/html/box_info.erb
@@ -23,6 +23,13 @@
<% n = n == 2 ? 1 : 2 %>
<% end %>
<% end %>
+ <% [[:class, "Extending"], [:instance, "Included in"]].each do |scope, name| %>
+ <% if (mixed_into = mixed_into(object, scope)).size > 0 %>
diff --git a/lib/yard/parser/source_parser.rb b/lib/yard/parser/source_parser.rb
index dc389af..a8aacc9 100644
--- a/lib/yard/parser/source_parser.rb
+++ b/lib/yard/parser/source_parser.rb
@@ -221,6 +221,8 @@ module YARD
case (File.extname(filename)[1..-1] || "").downcase
when "c", "cpp", "cxx"
:c
+ when "java"
+ :java
public class JRuby14StringSymbol {
public void sm(String bla) {
System.out.println("got " + bla);
}
}