
Below are the sets presently available, and their corresponding id. if you don't set an ID, one will be randomly chosen every run. Emoji icons may not render in certain terminals.
(pass, fail, pending)
| #!/usr/bin/env ruby | |
| s = gets | |
| while s | |
| map_old_to_new = {} | |
| available_digits = %w(0 1 2 3 4 5 6 7 8 9) | |
| (0..9).each do |old| | |
| new = available_digits.sample | |
| available_digits -= [new] | |
| map_old_to_new["#{old}"] = new |
| body.admin-bar .post-content h1 { | |
| border: 2px solid red; | |
| &:before { | |
| content: "Using H1 tags in post content is bad for SEO. Change to an H2 tag. (You're only seeing this because you're signed in as an admin. Your visitors won't see this warning)"; | |
| background-color: red; | |
| color: white; | |
| font-size: 1rem; | |
| line-height: 1; | |
| padding: 1em; |
| # Creating a whole new concern, introducing the `attr_immutable` macro | |
| module ImmutableAttributes | |
| class ImmutableAttributeError < StandardError; end | |
| extend ActiveSupport::Concern | |
| included do | |
| class_attribute :_attr_immutable, instance_accessor: false | |
| self._attr_immutable = [] | |
| end |
| class MyThing | |
| value: "My thing's value" | |
| skinny: -> | |
| console.log @value | |
| fat: => | |
| console.log @value | |
| otherThing = | |
| value: "Other's value" |
| # Set an environment from html meta tags. | |
| # | |
| # Usage: | |
| # | |
| # <meta name="ENV.station" content="swan" /> | |
| # <meta name="ENV.port" content="2342" /> | |
| # | |
| # The above meta tags would yield the following object: | |
| # | |
| # ENV = {'station': 'swan', 'port': 2342} |
| # In rails console. | |
| dumb = Struct.new(:field_with_name) | |
| [dumb.new(1), dumb.new(2), dumb.new(3)].sum(&:field_with_name) |
| // ==UserScript== | |
| // @name GitHub Labels | |
| // @namespace http://danott.co/ | |
| // @version 0.1 | |
| // @description Automatically add and remove "+1", "+2", and "NOT READY!" labels bast on comment contents. Included on all of github because pushState. | |
| // @include https://github.com/* | |
| // @copyright 2014+, @danott | |
| // ==/UserScript== | |
| var getLabelName = function() { |
| class App.BehavesLikeEventBindingView extends Batman.View | |
| fireOnSelfAndNearestAncestor: (event, args...) -> | |
| @[event]?.apply(@, args) | |
| if target = @superview?.targetForKeypath(event) | |
| target[event].apply(target, args) |
| # required on jsbin | |
| Batman.config.usePushState = false | |
| simpleStore = new Batman.Set() | |
| simpleStore.add new Batman.Object({name: "Red"}) | |
| simpleStore.add new Batman.Object({name: "Green"}) | |
| simpleStore.add new Batman.Object({name: "Blue"}) | |
| class App extends Batman.App | |
| @root "colors#index" |