Skip to content

Instantly share code, notes, and snippets.

Avatar

Harri Feng harrifeng

View GitHub Profile
View multi_emacs_config.org

Install Doom alongside other configs (with Chemacs2)

Chemacs2 is a bootloader for Emacs. It allows you to switch between multiple Emacs configurations. Here is a quick guide for setting it up with Doom Emacs as the default config:

  1. First, install Doom somewhere:
    git clone https://github.com/hlissner/doom-emacs ~/doom-emacs
    ~/doom-emacs/bin/doom install
        
View feature_103.md

Feature 103

This feature was previsouly created for old users. Recently, all the old users had already join new group.

Owner

Ada John

View python_max_size.py
>>> import sys
>>> sys.maxsize
9223372036854775807
View file_sever.go
package main
import (
"net/http"
"os"
)
func main() {
shareFolder := "/share"
if len(os.Args) > 1 {
@harrifeng
harrifeng / choco.txt
Created Oct 15, 2018
Choco local list
View choco.txt
autohotkey
cmder
git
github-desktop
GoogleChrome
nodejs
python
virtualbox
@harrifeng
harrifeng / install-tmux
Created Oct 8, 2018 — forked from suhlig/install-tmux
Install tmux 2.7 on rhel/centos 7
View install-tmux
# Install tmux on rhel/centos 7
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xvzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
@harrifeng
harrifeng / index.html
Created Sep 1, 2018
JS Bin [add your bin description] // source https://jsbin.com/xexivaw
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.js" integrity="sha256-Ezb5Nri+VAO8xJDHLcPCxS70Kfh+MUFw9OXLZZrdfCs=" crossorigin="anonymous"></script>
</head>
<body>
View Bento Boxes.md

Bento, a project by the same company that makes Chef, is a Packer-based project for building base boxes. Unlike http://vagrantbox.es, Bento just uses base operating systems from the manufacturers with no pre-installed software. All the boxes are hosted on S3 in the following format:

https://opscode-vm-bento.s3.amazonaws.com/vagrant/PROVIDER/opscode_OS-VERSION_chef-provisionerless.box

For example, Ubuntu 13.04 lives here for VirtualBox:

https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.04_chef-provisionerless.box

And the VMWare equivalent box lives:

View generator_object_as_parameter.py
def display(one):
print(type(one))
display(1)
display(i for i in range(32))
# <===================OUTPUT===================>
View logger-demo.py
import logging
from logging.handlers import RotatingFileHandler
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s(%(lineno)d) %(message)s')
logFile = '/tmp/demo.log'
my_handler = RotatingFileHandler(logFile, mode='a', maxBytes=5*1024*1024,
backupCount=2, encoding=None, delay=0)
my_handler.setFormatter(log_formatter)