Skip to content

Instantly share code, notes, and snippets.

@ericfode
ericfode / Chat.md
Created April 29, 2025 19:28
PDFs and the real numbers

Here’s a bird’s-eye view of what’s going on, why it trips up a lot of people, and how you could say it in two lines:

  1. A more succinct statement

“You can’t pick a real number uniformly at random from all of ℝ, because if you tried to assign every point probability p, then p·∞ would have to equal 1, forcing p=0—and yet you still pick exactly one number. That “paradox” dissolves once you use probability densities (for intervals) instead of point-probabilities.”

def is_rotated(nums: List[int]) -> bool:
first = nums[0]
last = nums[-1]
return first > last
def find_pivot(nums: List[int]) -> List[int]:
def search_pivot(nums: List[int], last_index_pointer:int , index_pointer: int) -> int:
cur = nums[index_pointer]
// jsonnet -S -V depth=5 hanoi.jsonnet >/tmp/hanoi.html && open /tmp/hanoi.html
local depth = std.parseInt(std.extVar('depth'));
local rect(width, height, column) = [
'rect',
{
width: width * 40,
height: 40,
x: (column + 1) * 300 - width * 20,
@ericfode
ericfode / index.html
Created May 6, 2020 03:56
JS Audio Visualizer
<div id="content">
<input type="file" id="thefile" accept="audio/*" />
<canvas id="canvas"></canvas>
<audio id="audio" controls></audio>
</div>
@ericfode
ericfode / pytorch-on-circleci.yml
Created October 21, 2019 16:45
yaml snippet for building pytorch.
build-pytorch:
machine:
image: windows-server-2019-nvidia:edge
steps:
- run:
name: Download cudnn
command: |
$output = "cudnn.zip"
$url = "https://storage.googleapis.com/circleci-image-file/cudnn-10.1-windows10-x64-v7.6.4.38.zip" #
(New-Object System.Net.WebClient).DownloadFile($url, $output)
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c3f78752a68a0c3f62efb3332cceea0c8a1f04f7cf6b46e00ec0c3000bc8483e'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Solarized'
Plugin 'SuperTab'
{"meta":{"code":200},"data":[{"id":235681245,"credit_id":351968,"address_id":71838242,"delivery_date":null,"user_id":9283,"charge_id":"ch_6hP6yk4XenlVrE","created_at":"2015-07-29T19:32:55.237Z","updated_at":"2015-07-29T21:01:26.217Z","total":"46.34","shipping_price":"0.0","receipt_sent_at":"2015-07-29T20:54:13.494Z","refund_amount":"0.0","refund_processed_at":null,"special_instructions":"ring doorbell number 1 with no name","subtotal":"40.3","coupon_discount":{"fractional":"0.0","currency":{"id":"usd","alternate_symbols":["US$"],"decimal_mark":".","disambiguate_symbol":null,"html_entity":"$","iso_code":"USD","iso_numeric":"840","name":"United States Dollar","priority":1,"smallest_denomination":1,"subunit":"Cent","subunit_to_unit":100,"symbol":"$","symbol_first":true,"thousands_separator":","},"bank":{"rounding_method":null,"rates":{},"mutex":{}}},"charge_amount":"46.34","canceled_at":null,"canceled_sent_at":null,"route_order":null,"refund_reason":null,"refund_special_message":null,"duplicate_of_id":null,"admi
@ericfode
ericfode / .spacemacs
Last active August 29, 2015 14:21
My spacemacs dot file
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@ericfode
ericfode / chef-standards
Last active August 29, 2015 14:08
Hello!
Prior art
===========
Cookbook style guides
---------------------
* https://github.com/ampledata/cookbook-style-guide
* https://github.com/infochimps-labs/ironfan/wiki/style_guide
* https://github.com/secondmarket/chef-style-guide
* http://acrmp.github.io/foodcritic/