Skip to content

Instantly share code, notes, and snippets.

@viix
viix / test.js
Created February 2, 2016 13:15 — forked from ProfAvery/test.js
Using Underscore.js from the Node.js REPL
/*
Per <http://stackoverflow.com/questions/5691901/using-the-underscore-module-with-node-js>,
from the Node.js REPL, use two underscores (__) instead of a single underscore (_)
because Node uses _ for the last return value.
Note that if your program is in a file, you can still use a single underscore (_).
*/
var __ = require("underscore");
__.each([1, 2, 3], function(e) { console.log(e); });
@viix
viix / Enhance.js
Created April 5, 2017 04:57 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@viix
viix / gist:22df380b138182385b780fff7182caf3
Last active September 20, 2018 11:15
ubuntu essential install script
// update nodejs
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install -y nodejs
nodejs -v
// install yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
@viix
viix / gist:91274de984f6bef81cbdb439b05d41f2
Created September 21, 2018 07:24
centos essential install script
sudo yum -y update
# nodejs
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install -y nodejs
node --version
# python3
sudo yum install centos-release-scl
sudo yum install rh-python36
@viix
viix / gist:cd0be8b0dc4b79955c88
Last active December 30, 2018 18:01
My cVim Configuration
unmap h
unmap l
unmap H
unmap L
map h goBack
map l goForward
map H scrollLeft
map L scrollRight
unmap K
unmap J
@viix
viix / manjaro setup
Last active February 3, 2019 16:49
on chromebook pixel
sudo pacman-mirrors -i -c China -m rank
sudo pacman -Syyu
vim ~/.Xresources
Xft.dpi: 192
vim /etc/X11/xorg.conf.d/30-touchpad.conf
Option "NaturalScrolling" "true"
sudo pacman -S shadowsocks