Skip to content

Instantly share code, notes, and snippets.

View khacanh's full-sized avatar
😀

khacanh khacanh

😀
  • Ho Chi Minh city
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active July 21, 2024 13:28
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@khacanh
khacanh / mdn.py
Last active February 11, 2019 23:20
Mixture density network with Tensorflow
# From http://blog.otoro.net/2015/11/24/mixture-density-networks-with-tensorflow/
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import math
NHIDDEN = 24
STDEV = 0.5
KMIX = 24 # number of mixtures
@sdrew
sdrew / HTTP-Status-Codes.md
Last active May 19, 2017 13:30
Mapping of HTTP Status Codes to Symbols in Rails, as found here: http://www.codyfauser.com/2008/7/4/rails-http-status-code-to-symbol-mapping

1xx Informational

Status Code Status Message Symbol
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing

2xx Success

class ApplicationController < ActionController::Base
...
#Problem:
#In rails 3.0.1+ it is no longer possible to do this anymore;
# rescue_from ActionController::RoutingError, :with => :render_not_found
#
#The ActionController::RoutingError thrown is not caught by rescue_from.
#The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error
#As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution
@chris
chris / nodejs_recipe.rb
Created May 13, 2011 05:55
Chef recipe to install node.js on Engine Yard AppCloud
#
# Cookbook Name:: nodejs
# Recipe:: default
#
# Build and install node.js
#
if ['app','app_master','solo'].include?(node[:instance_role])
version_tag = "v0.4.8"
source_base_dir = "/data/nodejs"
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')