Skip to content

Instantly share code, notes, and snippets.

View arafatkatze's full-sized avatar
💭
Lover of life and all things beautiful

Ara arafatkatze

💭
Lover of life and all things beautiful
View GitHub Profile
sourcegraph git:(main) brew services stop postgresql@15
brew uninstall postgresql@15
rm -rf /usr/local/var/postgres
rm /usr/local/var/log/postgres.log
rm -f ~/.psqlrc ~/.psql_history
Stopping `postgresql@15`... (might take a while)
==> Successfully stopped `postgresql@15` (label: homebrew.mxcl.postgresql@15)
Uninstalling /opt/homebrew/Cellar/postgresql@15/15.5_3... (3,700 files, 63MB)
rm: /usr/local/var/log/postgres.log: No such file or directory
➜ sourcegraph git:(main) git checkout jsm/sg-setup-pg
### 1. i think realistically women want both. and both of those groups each already have one, so they’re trying to acquire the other
### 2. the addictive & isolating cycle of deep work:
### 3. being articulate might be the most underrated skill of all time. it's *the* most direct path to influence (aside from inheritance). it's a core competency of all the characteristics that make people trust you, look to you for direction: persuasiveness, charisma, sales, leadership
### 4. filling life with beauty is such a low hanging fruit way to improve our day to day, but i feel like we sometimes forget that beauty isn’t just visual—it’s five dimensional. i made a list (non-exhaustive) to remind myself what feels beautiful to all five senses.
### 5. life feels VERY different when you go from optimizing for appearances (looking like you have your shit together, heading in a direction that seems "good") to optimizing for alignment (*feeling* like you have your shit together, headed in a direction that *you* are excit
@arafatkatze
arafatkatze / stream_time.py
Created October 29, 2023 10:43
A simple text to show how long it takes for streaming to start based on the prompt length sent to Claude API
from anthropic import Anthropic
import time
anthropic = Anthropic(api_key="claude-api-key")
prompt_lengths = [100, 1000, 10000, 50000]
for prompt_length in prompt_lengths:
# generate a prompt of the desired length
prompt = "Human: " + "cars are great " * (prompt_length // 5) + "write an essay on cars"
require 'rubyplot'
@x1 = []
@y1 = []
for i in 0..1000
num = Float(i) / Float(500)
puts num
x = Math.sin(num * Math::PI)
x = 16 * x * x * x
y = 13 * Math.cos(num * Math::PI) - 5 * Math.cos(2 * num * Math::PI) - 2 * Math.cos(3 * num * Math::PI) - 4 * Math.cos(num * Math::PI)
require 'rubyplot'
@datasets = [
[[20, 10, 5, 12, 11, 6, 10, 7], :Anna],
[[5, 10, 20, 6, 9, 12, 14, 8], :Jack],
[[19, 9, 6, 11, 12, 7, 15, 8], :Katie]
]
plot = Rubyplot::StackedBar.new(1000)
plot.title = 'Net earnings in different months'
plot.labels = {
0 => 'Jan',
g = Rubyplot::Figure.new
@x1 = [7, 3, 3, 5.6, 5.6, 7, 7, 9, 9, 8]
@y1 = [10, 10, 4, 4, 5.4, 5.4, 4, 4, 6, 6]
g.line! @x1, @y1, line_width: 4, line_color: :green
@x2 = [11, 11, 15, 15, 11.3, 15]
@y2 = [4, 10, 10, 7, 7, 4]
g.line! @x2, @y2, line_width: 5, line_color: :stormy_blue
cmd> plot "/var/folders/f0/g51qrlhs20zbb5f3qsn3y5r00000gn/T/go-gnuplot-444176234" title "Simple Circles" with circle
res> 112
cmd> replot "/var/folders/f0/g51qrlhs20zbb5f3qsn3y5r00000gn/T/go-gnuplot-408069569" title "Simple Lines" with lines
res> 111
cmd> set title "Test Plot"
res> 23
cmd> set xlabel 'X-Axis'
res> 20
cmd> set ylabel 'Y-Axis'
res> 20
@arafatkatze
arafatkatze / maps.go
Created May 8, 2018 18:14
An example of Maps in Dataviz
package main
import (
rbt "github.com/Arafatk/dataviz/trees/redblacktree"
)
func main() {
tree := rbt.NewWithIntComparator()
tree.Put(5, "e")
tree.Put(6, "f")
package main
import (
bheap "github.com/Arafatk/dataviz/trees/binaryheap"
)
func main() {
heap := bheap.NewWithIntComparator()
heap.Push(3)
heap.Push(19)
# Read the image file
image_file = File.new(Dir.pwd + '/break-captcha-protobuf/captcha-1.png', "r")
feeds_tensor = Tensorflow::Tensor.new(image_file.read)