Skip to content

Instantly share code, notes, and snippets.

View gcao's full-sized avatar

Guoliang Cao gcao

  • Apex, NC
  • 02:00 (UTC -04:00)
  • X @gcao99
View GitHub Profile
@gcao
gcao / CATCH_Keras_RL.md
Created July 2, 2016 14:33 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
@gcao
gcao / pg-pong.py
Created July 2, 2016 14:13
Modified version of https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5 (associated code for article "Deep Reinforcement Learning: Pong from Pixels")
# http://karpathy.github.io/2016/05/31/rl/
# https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5
# pip install gym
# pip install gym[atari]
# Changes to original code - required for Python 3
# http://stackoverflow.com/questions/10458437/what-is-the-difference-between-dict-items-and-dict-iteritems
# http://stackoverflow.com/questions/37132899/installing-cpickle-with-python-3-5
# http://stackoverflow.com/questions/15014310/why-is-there-no-xrange-function-in-python3
@gcao
gcao / todos.html
Last active January 2, 2016 21:29
A T.js template written in CoffeeScript
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>T.js example - a simple TODO list</title>
<script type="text/javascript" src="coffee-script.js"></script>
<script type="text/javascript" src="../javascripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../javascripts/t.js"></script>
<script type="text/coffeescript">
@gcao
gcao / test.rb
Created March 8, 2013 04:15
Ruby 2.0 prepend question
module B
def test
puts 'before B'
super
puts 'after B'
end
end
module C
def test
rvm use 1.9.3@perf_aspect --create
@gcao
gcao / dci_example.rb
Created January 19, 2013 23:53
DCI demonstration
require 'forwardable'
Data = Struct.new(:name)
class Role
extend Forwardable
def_delegators :@data, :name=
def initialize data
@gcao
gcao / slide_over.html
Created November 1, 2011 18:49
Slide animation
<html>
<head>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery-ui.min.js" type="text/javascript"></script>
</head>
<body>
<div id="test">Test</div>
<div style="top: 20px">
<div id='div1' style="width:100px; height:100px; background:#aaa">
Something goes here.
@gcao
gcao / .vimrc.local
Created October 26, 2011 14:37
.vimrc.local Used together with https://github.com/spf13/spf13-vim
color molokai
set nospell
set paste
set wrap
set hidden " Don't prompt to save buffer when changing to another buffer
set expandtab "Use :retab to replace tabs with spaces
set shiftwidth=2
set tabstop=2
set autoindent
@gcao
gcao / term_colors.rb
Created February 23, 2011 21:06
terminal colors
#!/usr/bin/ruby
printf "\033[0m0 All attributes off\033[0m\n"
printf "\033[1m1 Bold\033[0m\n"
printf "\033[4m4 Underline\033[0m\n"
printf "\033[5m5 Blink\033[0m\n"
printf "\033[7m7 Invert\033[0m\n"
printf "\033[8m8 Hide\033[0m = Hide\n"
printf "\033[30m30 Black\033[0m = Black\n"
printf "\033[31m31 Red\033[0m\n"
puts "\342\224\214\342\224\254\342\224\220"
puts "\342\224\234\342\224\274\342\224\244"
puts "\342\224\224\342\224\264\342\224\230"
# === OUTPUT ===
#┌┬┐
#├┼┤
#└┴┘
puts "\342\224\214\342\224\200\342\224\220"