Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile
title date tags categories
How to get started to build your own Spacemacs
2018-10-12 12:59
emacs
Tools

I have been a Vim user for quite a while. I love it, so the very first thing when I set up a new server is installing VIM. I heard a lot about Emacs and tried it. It's better at almost everything except text editing. So I stayed with Vim until Spacemacs was released. The Vim key bindings of Spacemacs is so excellent that I switched.

However, Spacemacs has its problem: boots up slowly and crashes frequently. Upgrading packages became very challenging. Finally, I have to use the develop branch because the master branch is not working anymore. People began to complain and requested to speed up the release from the master branch. Considering its dependencies and numerous open issues, I have no hope for this.

###########################
# Common Configuration
###########################
set -g default-terminal "screen-256color"
# use vim key bindings
setw -g mode-keys vi
# increase repeat time for repeatable commands
@yaodong
yaodong / __init__.py
Last active February 20, 2022 17:12
a service layer use flask local stack
from functools import partial
from flask import Flask
from flask import current_app
from werkzeug.local import LocalProxy
from werkzeug.local import LocalStack
from .boto import Boto3Service
from .cognito import CognitoService
@yaodong
yaodong / gist:f5b785c5b17337ce1b9a
Created February 11, 2016 23:15
things cloud requests
login
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com
get key
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com/own-history-keys
get index
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Accept-Language: en-us" --compressed https:
Server Error in '/' Application.
The network path was not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The network path was not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
---
- hosts: manage
remote_user: root
tasks:
- name: install dependencies
apt:
package:
- apt-transport-https
- ca-certificates
- curl
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engine)
session = Session()
from datetime import datetime
const fs = require('fs')
const crypto = require('crypto')
const publicKey = fs.readFileSync('public.pem')
const privateKey = fs.readFileSync('private.pem')
const message = 'Hello, world!'
const encryptedMsg = crypto.publicEncrypt(publicKey, Buffer.from(message, 'utf8'))
console.log('encrypted by private key: ' + encryptedMsg.toString('hex'))
a.js
const mapDispatchToProps = (dispatch) => {
create: function(name) {
dispatch(createUser(name));
dispatch(displayUser(name));
}
}
connect(mapDispatchToProps)(A)
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591