Skip to content

Instantly share code, notes, and snippets.

@yetone
yetone / svm.py
Created July 24, 2017 10:38 — forked from mblondel/svm.py
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
@yetone
yetone / .pylintrc
Created December 11, 2017 02:30 — forked from xen/.pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@yetone
yetone / who-weibo.js
Created January 15, 2018 02:33 — forked from zh-h/who-weibo.js
是谁发的微博微博图片
function decodeBase62(number) {
var alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
var out = 0
var len = number.length - 1
for (var t = 0; t <= len; t++) {
out = out + alphabet.indexOf(number.substr(t, 1)) * Math.pow(62, len - t)
}
return out
}
@yetone
yetone / !.md
Last active January 19, 2018 08:12
Carbon to SVG
@yetone
yetone / Dockerfile
Last active June 15, 2018 10:36
compile jdk
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y wget gcc g++ make ant gawk libcups2-dev libfreetype6-dev libxtst-dev libxrender-dev cpio X11* python-software-properties software-properties-common
RUN apt-get install -y vim
RUN apt-get install -y zip unzip libasound2-dev
RUN apt-get install -y aria2
RUN mkdir -p /usr/lib/jvm && cd /usr/lib/jvm && aria2c -x4 http://bridsys.com/downloads/java/jdk-6u45-linux-x64.bin && \
chmod a+x ./jdk-6u45-linux-x64.bin && ./jdk-6u45-linux-x64.bin
RUN ln -sf -b /usr/lib/jvm/jdk1.6.0_45/jre/bin/java /etc/alternatives/java && ln -sf -b /usr/lib/jvm/jdk1.6.0_45/jre/bin/java /usr/bin/java
@yetone
yetone / README-Template.md
Created November 16, 2018 07:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@yetone
yetone / karabiner.json
Last active September 6, 2021 05:02
Karabiner 通过 left shift 来切换中英文
{
"description": "Switch between zh-Hans <-> en (left_shift)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"language": "en"
}
__cursor_pos () {
local pos
exec {tty}<>/dev/tty
echo -n '\e[6n' >&$tty; read -rsdR pos <&$tty
exec {tty}>&-
[[ $pos =~ '([0-9]+);([0-9]+)$' ]]
print $match[1] $match[2]
}
__calc_height () {
{
"Ansi 4 Color" : {
"Red Component" : 0.34117650985717773,
"Color Space" : "sRGB",
"Blue Component" : 0.99999994039535522,
"Alpha Component" : 1,
"Green Component" : 0.78039222955703735
},
"Tags" : [