Skip to content

Instantly share code, notes, and snippets.

wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
tar pxf openssl-1.1.1l.tar.gz
cd openssl-1.1.1l
sudo aptitude install gcc-mingw-w64 gcc-mingw-w64-i686
sudo ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/windres
./Configure --prefix=$PWD/dist no-idea no-mdc2 no-rc5 shared mingw
sed -i 's|RCFLAGS=.*|RCFLAGS= --target=pe-i386 -I/usr/i686-w64-mingw32/include -D_WIN32|g' Makefile
make install
@DavidPu
DavidPu / classdojo_media_files.js
Last active June 11, 2020 23:07
download all class dojo media files.
(function classdojo_scroll() {
var page_scroll_delay = 5000; // ms
var offset = 0; // localStorage.getItem('offset') || 0;
console.log('inital offset:', offset);
window.all_media_urls = new Map();
// return false if scroll to the end..
function scroll_down() {
offset += 800;
@DavidPu
DavidPu / alt.go
Created March 28, 2020 07:24 — forked from sanatgersappa/alt.go
Alternative handler for multiple file uploads in Go.
package main
import (
"html/template"
"io"
"net/http"
"os"
)
//Compile templates on start
@DavidPu
DavidPu / build_clang-tidy.sh
Last active May 5, 2019 18:40
build_clang-tidy.sh
set -xeuo pipefail
readonly SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
SRC_ROOT=${SCRIPT_DIR}/src
mkdir -p ${SRC_ROOT}
cd ${SRC_ROOT}
git clone https://git.llvm.org/git/llvm.git
cd llvm/tools
git clone https://git.llvm.org/git/clang.git
cd clang/tools
diff --git a/Modules/Setup.dist b/Modules/Setup
index e469d5e..3fea7df 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -387,3 +387,12 @@ _symtable symtablemodule.c
# Another example -- the 'xxsubtype' module shows C-level subtyping in action
xxsubtype xxsubtype.c
+
+SSL=$(srcdir)/openssl
self.session = requests.Session()
self.session.verify = True
# get the cert:
# openssl s_client -connect www.google.com:443 -showcerts > google.ca
# apend the last cert into $(dirname $(which python))/../lib/python*/site-packages/certifi/cacert.pem
XTerm*faceName: Bitstream Vera Serif Mono
xterm*faceSize: 11
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*loginShell: true
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-color
xterm*eightBitInput: false
!BLK Cursor
@DavidPu
DavidPu / pyenv_mgr.sh
Last active March 16, 2018 01:34
manage python environment
#!/bin/bash
# download differnet python versions..
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export PATH=~/.pyenv/bin:$PATH
pyenv install 3.6.4
pyenv install 2.7.14
# create Python 3 environment:
export PYTHONHOME=~/.pyenv/versions/3.6.4
~/.pyenv/versions/3.6.4/bin/python -m venv <my_py_env_folder>
@DavidPu
DavidPu / hotkeys.md
Last active December 28, 2017 18:52

Windows

move window between monitors

WIN+SHIFT+ARROW

Chrome

address bar

F6

switch tab

CTRL+TAB