const language = {
name: 'JavaScript',
author: 'Brendan Eich'
};
// Inheriting from another object.
Object.setPrototypeOf(language, {createdAt: "Netscape"});
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
To make this work like Ryan's original fish shell, install the following ZSH plugins and use the sobol.zsh-theme. | |
https://github.com/zsh-users/zsh-autosuggestions | |
https://github.com/zsh-users/zsh-syntax-highlighting | |
Add this command to your zshrc file. | |
alias gbra="git branch | grep -v "master" | grep -v "main" | xargs git branch -D" |
Author: Chris Lattner
- Proposal: SE-XXXX
- Authors: Chris Lattner, Joe Groff
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.
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
module Heroku | |
class StaticAssetsMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# call returns an array containing [response code, header, Rack::Response] | |
reply = @app.call(env) |
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
# Ensure AssetTagHelper has been loaded before we try to monkey-patch it. | |
require 'action_view/helpers/asset_tag_helper' | |
module ActionView::Helpers::AssetTagHelper | |
# Insert the asset id in the filename, rather than in the query string. In | |
# addition to looking nicer, this also keeps any other static file handlers | |
# from preempting our Rack::StaticCache middleware, since these | |
# version-numbered files don't actually exist on disk. | |
def rewrite_asset_path(source) | |
source.insert source.rindex('.'), "-#{rails_asset_id(source)}" |