Skip to content

Instantly share code, notes, and snippets.

Avatar

Yaodong Zhao yaodong

View GitHub Profile
View pandaexpress-error.log
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.
View ansible-install-docker.yml
---
- hosts: manage
remote_user: root
tasks:
- name: install dependencies
apt:
package:
- apt-transport-https
- ca-certificates
- curl
View sqlalchemy-exmple.py
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
View crypto-example.js
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'))
View tmux.conf
###########################
# Common Configuration
###########################
set -g default-terminal "screen-256color"
# use vim key bindings
setw -g mode-keys vi
# increase repeat time for repeatable commands
View gist:6e00d7d15a2a316d26ad1ff7a8b18f94
a.js
const mapDispatchToProps = (dispatch) => {
create: function(name) {
dispatch(createUser(name));
dispatch(displayUser(name));
}
}
connect(mapDispatchToProps)(A)
View How to get started to build your own Spacemacs.md
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.

View download_leetcode_problem_list.rb
#!/usr/bin/ruby
require 'net/http'
require 'json'
require 'yaml'
url = URI('https://leetcode.com/api/problems/algorithms/')
res = Net::HTTP.get(url)
data = JSON.parse(res)
problems = data['stat_status_pairs'].map do |pair|
View create-react-app-README.md

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

View robotPath.java
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String args[] ) throws Exception {
int[][] input = new int[][]{
You can’t perform that action at this time.