Skip to content

Instantly share code, notes, and snippets.

View linyiru's full-sized avatar
🐝

Lawrence Lin linyiru

🐝
View GitHub Profile

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Realtime Notifications with ActionCable

In this episode we're going to be adding realtime notifications into your app using ActionCable. We've talked about notifications a few times in the past and we used AJAX polling for that. 95% of the time, polling is the solution that would be recommended for it.

But if you're looking for a good introduction into ActionCable then this is a decent one because we're only really using it for one way from the server side to the client side.

Getting started

So to get started we're starting with an app that has Bootstrap installed and then we created a Main controller with an index view which is where we will list our Notifications as for this example.

Before we generate our channels let's install a few things

@linyiru
linyiru / glcoud-signed-url.go
Created August 9, 2019 13:08 — forked from poindextrose/glcoud-signed-url.go
Example on how to create a signed URL on Google Cloud Storage with Go
package main
import (
"fmt"
"time"
"google.golang.org/cloud/storage"
)
const (
@linyiru
linyiru / gist:f595e5468c7f5e0c3fc2d8433b5ab6d6
Created May 19, 2020 06:14 — forked from jatcwang/gist:ae3b7019f219b8cdc6798329108c9aee
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@linyiru
linyiru / agent.rb
Created January 8, 2025 01:42 — forked from elct9620/agent.rb
A minimal AI agent inspired by ihower
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'dotenv'
gem 'ruby-openai'
end
@linyiru
linyiru / .cursorrules
Created January 10, 2025 19:06 — forked from dpaluy/.cursorrules
CursorAI for Rails
# General Ruby Styling
PREFER_RUBY_SYNTAX: >
- Use Ruby 3.x syntax
- Use snake_case for methods and variables
- Use CamelCase for classes and modules
- Use SCREAMING_SNAKE_CASE for constants
- Prefer string interpolation over concatenation
- Use modern hash syntax: { key: value }
- Use double quotes only when interpolation is needed
var bankTypes = [
{"code": "0", "name": "中華郵政"},
{"code": "1", "name": "信用合作社"},
{"code": "2", "name": "國內外銀行"},
{"code": "3", "name": "漁會"},
{"code": "4", "name": "農會"}
];
var bankCodes = {
"0": [