Skip to content

Instantly share code, notes, and snippets.

View foxundermoon's full-sized avatar
🏠
Looking for a remote job

foxundermoon foxundermoon

🏠
Looking for a remote job
View GitHub Profile
@foxundermoon
foxundermoon / HOC.js
Created February 1, 2020 11:49 — forked from Restuta/HOC.js
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {
@foxundermoon
foxundermoon / socks5.go
Last active September 7, 2015 07:04 — forked from maliubiao/socks5.go
Socks5RoundTripper for net/http
package socks5
import (
"net"
"time"
"bytes"
"errors"
"bufio"
"strconv"
"strings"
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
hg clone https://vim.googlecode.com/hg/ vim
sudo yum install -y ruby ruby-devel lua lua-devel luajit luajit-devel ctags mercurial python python-devel python3 python3-devel tcl-devel perl perl-devel perl-ExtUtils-ParseXS perl-ExtUtils-XSpp perl-ExtUtils-CBuilder perl-ExtUtils-Embed ncurses-devel
./configure --with-features=huge --enable-multibyte --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-luainterp --enable-gui=gtk2 --enable-cscope --with-tlib=ncurses --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install

在 VIM 内执行