If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.
This file contains hidden or 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
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
This file contains hidden or 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
| // Y Combinator | |
| const Y = a => (b => b (b)) (b => a (c => b (b) (c))) | |
| // isomorphic Church encoding/decoding | |
| const Church = { | |
| to: n => f => x => Array.from (Array (n)).reduce (f, x), | |
| from: f => f (x => x + 1) (0) | |
| } | |
| const True = a => b => a |
I recently had to upgrade my blog, which involved changes such as:
- Replacing a sitemap plugin
- Upgrading from jekyll 2.5.3 to 3.8.4
- Upgrading from jekyll-assets 0.7.8 to 3.0.11
- (etc)
The upgrading process was not trivial, and some parts (e.g. RSS, sitemap, or twitter cards tags) are not immediately visible, so I decided to add unit tests on the generated content.
This file contains hidden or 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
| gem 'rails_event_store' | |
| generate 'rails_event_store_active_record:migration' | |
| rails_command 'db:migrate' | |
| initializer 'rails_event_store.rb', <<-CODE | |
| Rails.configuration.to_prepare do | |
| Rails.configuration.event_store = RailsEventStore::Client.new | |
| end | |
| CODE | |
This file contains hidden or 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
| -- Create the raw events table | |
| CREATE TABLE page_views ( | |
| site_id int, | |
| path text, | |
| client_ip inet, | |
| view_time timestamptz default now(), | |
| view_id bigserial | |
| ); | |
| -- Allow fast lookups of ranges of sequence IDs |
This file contains hidden or 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
| Some#method |
This file contains hidden or 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
| // Usage: | |
| // | |
| // function loader() { | |
| // return new Promise((resolve) => { | |
| // if (process.env.LAZY_LOAD) { | |
| // require.ensure([], (require) => { | |
| // resolve(require('./SomeComponent').default); | |
| // }); | |
| // } | |
| // }); |
NewerOlder
