Skip to content

Instantly share code, notes, and snippets.

View guanghwang's full-sized avatar
🎯
Focusing

gh guanghwang

🎯
Focusing
View GitHub Profile
@13bzhang
13bzhang / predict_lm.R
Last active February 11, 2020 00:49
Prediction function for linear regression with robust/cluster robust standard errors
predict.lm <- function(mod, predict.df, rob, cluster = NULL){
##Written by Joshua Gubler ~ http://scholar.byu.edu/jgubler
##Last updated on 26 June 2014
##Updated by Baobao Zhang
##This provides an option for robust (including cluster robust) or non-robust standard errors
##Note: when estimating a polynomial, you must create the quadratic/cubic as a separate variable first!! This is also the best procedure when estimating logged effects. However, when estimating interaction effects, there is no need to create a separate interaction term.
##Also note, that for this function to work well, you must input factor variables with more than two levels individually (as indiviual dummies).
if(missing(predict.df)){ predict1.df <- mod$model }

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@xuxiaodong
xuxiaodong / config
Last active October 29, 2020 00:34
Sway config
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
@viewv
viewv / updater.py
Created November 30, 2019 07:33
A simple Clash config file downloader for Linux in python.
import os
import requests
from ruamel import yaml
from tqdm import tqdm
URL = "Your Url"
PATH = "Your Config Path"
NAME = "config.yml"
IPHOST = "127.0.0.1:1234" # external-controller
@alexeyknorre
alexeyknorre / stargazer_fix.r
Created May 31, 2022 04:50
Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
## Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
# Unload stargazer if loaded
detach("package:stargazer",unload=T)
# Delete it
remove.packages("stargazer")
# Download the source
download.file("https://cran.r-project.org/src/contrib/stargazer_5.2.3.tar.gz", destfile = "stargazer_5.2.3.tar.gz")
# Unpack
untar("stargazer_5.2.3.tar.gz")
# Read the sourcefile with .inside.bracket fun