Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block jtoy

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
jtoy / gist:2fee28d8931de0ce6b5883e4b5658560
Created Mar 3, 2018
Coach tensorflow cpu - Dockerfile
View gist:2fee28d8931de0ce6b5883e4b5658560
FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y --no-install-recommends \
python3-pip python3-dev cmake zlib1g-dev python3-tk python-opencv build-essential
RUN pip3 install --upgrade pip
RUN pip3 install virtualenv
RUN pip3 install setuptools
RUN mkdir -p /coach
jtoy /
Created Dec 26, 2017 — forked from eevee/
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
View etst
View git hub repo info
Status: 200 OK
Link: <>; rel="next"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
"id": 1296269,
"owner": {
"login": "octocat",
"id": 1,
View naive-bayes.clj
;; 訓練データ
(def text_classified_p '(["good" "bad" "good" "good"]
["exciting" "exciting"]
["good" "good" "exciting" "boring"]))
(def text_classified_n '(["bad" "boring" "boring" "boring"]
["bad" "good" "bad"]
["bad" "bad" "boring" "exciting"]))
(defn train [features]
jtoy /
Created Apr 28, 2012 — forked from dvryaboy/
Shell script to kill orphaned Hadoop Task processes
# Kill tasks holding on to deleted userlogs. These are most likely abandoned jobs.
function get_bad_pids {
for i in `ps -ef | grep java | awk '{print $2;}'`; do
cnt=`/usr/sbin/lsof -p $i | grep deleted | grep /var/log/hadoop-0.20/userlogs/attempt | wc -l`;
if [ $cnt -gt 0 ]; then
View gist:2322942
(require '[clj-http.client :as client])
(defn extract_domain [domain]
(println domain)
(let [unrolled_url (try (:trace-redirects (client/get domain {:throw-entire-message? true})) (catch Exception _ domain))]
(.getHost ( unrolled_url))))
(extract_domain "")
jtoy / gist:1844519
Created Feb 16, 2012
this eats up all the memory on rsolr
View gist:1844519
require 'rsolr'
require 'thread'
require "optparse"
$opts = {}
Thread.abort_on_exception = true
threads = []
$q =
jtoy / gist:1494874
Created Dec 19, 2011
kill em / redis / bloomfilter
View gist:1494874
require 'redis'
require 'redis/connection/synchrony'
require "em-synchrony/fiber_iterator"
require 'bloomfilter-rb'
max = 10_000
EM.synchrony do
LBF = => max, :hashes => 2, :seed => 1,:namespace => "test")
process_queue = lambda do{
View em-http-retry.rb
require 'em-http' do
def dispatch(opts)
puts opts
h =[:uri]).get
h.callback { |rep| opts[:cb].call(rep) if opts[:cb] }
You can’t perform that action at this time.