Skip to content

Instantly share code, notes, and snippets.

View renjiege's full-sized avatar

Renjie Ge renjiege

View GitHub Profile
@renjiege
renjiege / default nginx configuration file
Last active April 29, 2022 02:17 — forked from xameeramir/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
## Personal note: Muslims are not terrorists and I humbly request my engineering community to help end racism.
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@renjiege
renjiege / cifar10-darknet-gist0509.ipynb
Created October 26, 2018 05:32 — forked from daveluo/cifar10-darknet-gist0509.ipynb
Demo of CPU-only Predictions and Pytorch Model Saving/Loading, 5/9/2018
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@renjiege
renjiege / sexselection_regressions_census1990.do
Created November 26, 2017 16:36
This file shows how I analyze data, generate summary statistics, and produce graphs and tables.
* sexselection_regressions_census1990.do (This file also produces graph results, see section 8)
* First Run sexselection_trimmed_census1990.do
* In this version, DT1-DT2 are added, P value of F-tests are dropped
* Difference between V3: change defintion of D1 and DT1
* For how to get datasets sexselection_merge_culs.dta, check figures_education_quality_culs2001_robustness
clear all
@renjiege
renjiege / modelprediction.do
Created November 25, 2017 23:18
Conducting predictive analysis with complete or quasi-complete separation data.
* modelprediction.do
* Predict Y2 *
clear
set more off
/*
cd /Users/renjiege/Documents/taskdata/
import delimited "/Users/renjiege/Documents/taskdata/Modeling_C.csv", encoding(ISO-8859-1)
save Modeling_C.dta, replace
xx
@renjiege
renjiege / mdb.do
Created November 25, 2017 23:12
Parsing textual data and extracting information with regular expression.
cd /Users/renjiege/Dropbox/workslot/mystata/Fernanda_Worldbank
set more off
use ida15_zichao.dta, clear
sort country
save ida15_zichao.dta, replace
*insheet using "/Users/renjiege/Downloads/ppijuly8.csv", clear
cd /Users/renjiege/Downloads/
use ppijuly8_zichao.dta, clear
@renjiege
renjiege / hetergeneous_agent_model.m
Last active November 26, 2017 16:31
Using the Endogenous Grid Method to solve the Heterogeneous Agent Model.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Growth Model with Idiosyncratic Shock
% Reference: Huggett, 1997
% Renjie Ge
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@renjiege
renjiege / endogenous_grid_method.m
Last active November 26, 2017 16:32
Using the Endogenous Grid Method to solve the Euler Equation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Euler Equation Methods
% Renjie Ge
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; clc; close all;
% Initialization
@renjiege
renjiege / yel_rockville.py
Created November 25, 2017 23:05
A simple web crawler to scrape restaurant information from Yelp.com.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2017-01-04 01:22:44
# Project: yelp_rockville
from pyspider.libs.base_handler import *
import re
home = '13005 Twinbrook Parkway'
@renjiege
renjiege / download_graduation_rates.py
Last active November 25, 2017 23:01
This code is used to operate web automation to download IPEDS data.
from zipfile import ZipFile
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from random import uniform
import time
from selenium.common.exceptions import NoSuchElementException
import re
import os
from urllib.request import urlopen
import json