Skip to content

Instantly share code, notes, and snippets.

Daniel Cox danielpcox

Block or report user

Report or block danielpcox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danielpcox
danielpcox / DemoPPOPong.ipynb
Last active Apr 17, 2019
danielpcox/notebooks/RL/DemoModel.ipynb
View DemoPPOPong.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tensorflow-with-gpu.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CIFAR trainer.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielpcox
danielpcox / GAN.ipynb
Created Aug 7, 2018
Dev Nag's GAN tutorial
View GAN.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielpcox
danielpcox / PongPreprocessing.ipynb
Created Jul 3, 2018
Preprocessing examples for OpenAI Gym environments
View PongPreprocessing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielpcox
danielpcox / post-merge
Last active Dec 30, 2016 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
View newtons.go
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := 1.0
l := 0.0
View Toyota.rb
def hex_to_bytes(str)
str.chars.each_slice(2).map {|s| s.join.to_i(16)}
end
def hex_to_bits(str)
str.chars.each_slice(2).flat_map {|s| s.join.to_i(16).to_s(2).rjust(8,"0").split("")}
end
def bytes_to_binary(bytes)
bytes.flat_map {|b| b.to_s(2).rjust(8,"0").split("")}
@danielpcox
danielpcox / rotate.clj
Last active Aug 29, 2015
Rotate Sequence
View rotate.clj
; Solving 4Clojure 44
; first try
(def rotate
(fn [n xs]
(if (= n 0)
xs
(let [nextn (* (dec (Math/abs n)) (if (< n 0) -1 1))
nextxs (and (not= 0 n)
(if (< n 0)
@danielpcox
danielpcox / deep-merge-spec.clj
Created Mar 11, 2015
Simple, recursive deep-merge in Clojure.
View deep-merge-spec.clj
(ns deep-merge-spec
(:require [midje.sweet :refer :all]
[util :as u]))
(fact (u/deep-merge {:one 1 :two 2}
{:one 1 :two {}})
=> {:one 1 :two {}})
(fact (u/deep-merge {:one 1 :two {:three 3 :four {:five 5}}}
{:two {:three {:test true}}})
You can’t perform that action at this time.