Skip to content

Instantly share code, notes, and snippets.

@hanxue
hanxue / PMI.vue
Last active February 22, 2018 19:26
Webpack 3 Vue.js error
<template>
<form novalidate class="md-layout-row md-gutter" @submit.prevent="validateUser">
<md-card class="md-flex-50 md-flex-small-100">
<md-card-header>
<div class="md-title">PMI Calculator</div>
</md-card-header>
<md-card-content>
<div class="md-layout-row md-layout-wrap md-gutter">
<div class="md-flex md-flex-small-100">
@hanxue
hanxue / PMI.vue
Created February 22, 2018 19:22
Webpack 4 Vue.js error
<template>
<form novalidate class="md-layout-row md-gutter" @submit.prevent="validateUser">
<md-card class="md-flex-50 md-flex-small-100">
<md-card-header>
<div class="md-title">PMI Calculator</div>
</md-card-header>
<md-card-content>
<div class="md-layout-row md-layout-wrap md-gutter">
<div class="md-flex md-flex-small-100">
@hanxue
hanxue / webpack.conf.js
Created January 5, 2018 07:36
Webpack conf for Vue
var path = require('path')
const merge = require('webpack-merge');
const NpmInstallPlugin = require('npm-install-webpack2-plugin');
var webpack = require('webpack')
var ManifestPlugin = require('webpack-manifest-plugin')
var InlineChunkManifestHtmlWebpackPlugin = require('inline-chunk-manifest-html-webpack-plugin')
var WebpackChunkHash = require("webpack-chunk-hash")
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var CleanWebpackPlugin = require('clean-webpack-plugin')
@hanxue
hanxue / npm-ls.txt
Last active November 8, 2017 15:17
pnpm install not detected by npm
[email protected] /Users/hanxue/DrRed/Quest-electron
├─┬ UNMET DEPENDENCY [email protected]
│ ├─┬ UNMET DEPENDENCY [email protected]
│ │ └── UNMET DEPENDENCY [email protected]
│ ├── UNMET DEPENDENCY [email protected]
│ ├─┬ UNMET DEPENDENCY [email protected]
│ │ └── UNMET DEPENDENCY [email protected]
│ ├─┬ UNMET DEPENDENCY [email protected]
│ │ └── UNMET DEPENDENCY [email protected]
│ ├─┬ UNMET DEPENDENCY [email protected]
@hanxue
hanxue / cpan_install_SVN.log
Created November 8, 2017 03:18
Perl CPAN install Alien::SVN error
$ cpan Alien::SVN
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/Users/hanxue/.cpan/Metadata'
Database was generated on Tue, 07 Nov 2017 15:54:18 GMT
Running install for module 'Alien::SVN'
Checksum for /Users/hanxue/.cpan/sources/authors/id/M/MS/MSCHWERN/Alien-SVN-v1.8.11.0.tar.gz ok
'YAML' not installed, will not store persistent state
---- Unsatisfied dependencies detected during ----
---- MSCHWERN/Alien-SVN-v1.8.11.0.tar.gz ----
Module::Build [build_requires]
@hanxue
hanxue / npm-debug.log
Created November 5, 2017 14:13
npm Module did not self-register
$ npm install -g pnpm
/usr/local/bin/pnpm -> /usr/local/lib/node_modules/pnpm/lib/bin/pnpm.js
/usr/local/bin/pnpx -> /usr/local/lib/node_modules/pnpm/lib/bin/pnpx.js
> [email protected] install /usr/local/lib/node_modules/pnpm/node_modules/drivelist
> prebuild-install || node-gyp rebuild
prebuild-install info begin Prebuild-install version 2.3.0
prebuild-install info looking for local prebuild @ prebuilds/drivelist-v5.2.6-node-v57-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/hanxue/.npm/_prebuilds/https-github.com-resin-io-modules-drivelist-releases-download-v5.2.6-drivelist-v5.2.6-node-v57-darwin-x64.tar.gz
@hanxue
hanxue / Screenshot.md
Last active November 2, 2017 04:54
vscode highlights ruby templating wrongly
@hanxue
hanxue / curl.bash
Last active October 29, 2017 09:43
curl webmshare.com upload video
# Load initial page and store cookies in webmshare_cookies.txt
curl 'https://webmshare.com/'--cookie-jar webmshare_cookies.txt -H 'dnt: 1' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3250.0 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'authority: webmshare.com' --compressed
# Upload and Re-use the cookie, with file size and other form fields
curl 'https://webmshare.com/upload' -X POST --cebmshare_cookies.txt -H 'origin: https://webmshare.com' -H 'accept-encoding: gzip, deflate, br' -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundaryfCpoSYnkWaeAUHI7' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'cache-control: max-age=0' -H 'authority: webmshare.com' -H 'referer: https://webmshare.com/
@hanxue
hanxue / api.py
Last active August 19, 2021 07:26
Flask-restful with POST and PATCH methods
from flask import Flask
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
class PostAndPatch(Resource):
def post(self):
@hanxue
hanxue / combined.png
Last active October 25, 2017 09:09
Demo of copying PNG image to clipboard in macOS
combined.png