Skip to content

Instantly share code, notes, and snippets.

View ryansobol's full-sized avatar

Ryan Sobol ryansobol

  • Ryan Sobol LLC
  • Seattle, WA
  • 16:16 (UTC -07:00)
View GitHub Profile
@brybrophy
brybrophy / Notes
Last active January 11, 2023 20:13
This zsh theme is based on Ryan Sobol's fish shell theme.
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"
@pajaydev
pajaydev / js-objects-compare.md
Last active April 5, 2024 01:47
JS Objects : Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

const language = {
  name: 'JavaScript',
  author: 'Brendan Eich'
};

// Inheriting from another object.
Object.setPrototypeOf(language, {createdAt: "Netscape"});
@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 18, 2024 09:44
Swift Concurrency Manifesto
@lattner
lattner / async_swift_proposal.md
Last active February 23, 2024 11:41 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

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.

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)
@matthewtodd
matthewtodd / asset_tag_helper.rb
Created July 12, 2010 04:57
Rails + Sass + Asset Fingerprints + Heroku
# 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)}"