Skip to content

Instantly share code, notes, and snippets.

View yfwu's full-sized avatar

Yu-Fu Wu yfwu

View GitHub Profile
@yfwu
yfwu / robot.js
Created December 7, 2012 05:59
Zolmeister
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
(ns rbl.feature-extraction.user-agent
(:use [clojure.core.memoize :only [memo]])
(:require [clojure.tools.logging :as log])
(:import [nl.bitwalker.useragentutils UserAgent DeviceType Browser OperatingSystem]))
(defn str->features [string]
(try
(let [user-agent (UserAgent. (or string ""))]
{:browser_group (-> user-agent .getBrowser .getGroup .getName)
:os_group (-> user-agent .getOperatingSystem .getGroup .getName)
#!/bin/bash
FILES=`find -iname *.txt -print`
for FILE in $FILES
do
# replace the + to # chars
sed -i -r 's/^([+]{4})\s/#### /' $FILE
sed -i -r 's/^([+]{3})\s/### /' $FILE
sed -i -r 's/^([+]{2})\s/## /' $FILE
sed -i -r 's/^([+]{1})\s/# /' $FILE
sed -i -r 's/(\[php\])/<?php/' $FILE
;;; nodejs-repl-eval.el --- Summary
;;; Commentary:
;;;
;;; Evaluation functions for the `nodejs-repl' package. Written on a stormy
;;; night between days of node hacking.
;;;
;;; Code:
(require 'js2-mode)
(require 'nodejs-repl)
@yfwu
yfwu / tsv2csv.py
Last active April 7, 2016 14:36 — forked from 101001417/tsv2csv
tsv2csv
import csv
# he underlying Windows text file mechanism cuts in and changes that \n to \r\n ... total effect: \r\r\n
# Refs: http://stackoverflow.com/questions/1170214/pythons-csv-writer-produces-wrong-line-terminator/1170297#1170297
with open('AllNet5.csv', 'w') as out:
reader = csv.reader(open('AllNet5.net', 'r'), delimiter="\t")
for row in reader:
out.write(','.join(row) + '\n')
conda create -n orange python=3.4 numpy scipy scikit-learn docutils beautifulsoup4 nose Sphinx xlrd pyqt psycopg2
source activate orange
pip install bottlechest
pip install chardet
pip install recommonmark
pip install pyqtgraph
pip install qt-graph-helpers
git clone https://github.com/biolab/orange3.git
@yfwu
yfwu / wordle.md
Created February 4, 2022 16:09 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode: