This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
x = 0 | |
plotX = [] | |
plotY = [] | |
for k in np.arange(0, 2, 0.01): | |
for i in range(0, 600): | |
x = 1 - k * x ** 2 | |
if (i > 500): | |
plotX.append(k) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# Shell Snippet # | |
########################## | |
# input | |
read flag | |
if [ "$flag" = "n" ]; then | |
echo NO | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bcdedit /set hypervisorlaunchtype off | |
bcdedit /set hypervisorlaunchtype auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
import subprocess | |
import os | |
import re | |
import sys | |
import youtube_dl | |
# Configuration Here | |
ydl_opts = { | |
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Please refer to https://developers.google.com/calendar/quickstart/nodejs for full documentation | |
*/ | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const { google } = require('googleapis'); | |
// If modifying these scopes, delete token.json. | |
const SCOPES = ['https://www.googleapis.com/auth/calendar']; | |
// The file token.json stores the user's access and refresh tokens, and is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 多图并排 | |
\begin{figure}[htbp] | |
\centering | |
\begin{minipage}[t]{0.48\textwidth} | |
\centering | |
\includegraphics[width=.95\textwidth]{path-to-pic} | |
\caption{} | |
\label{} | |
\end{minipage} | |
\begin{minipage}[t]{0.48\textwidth} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH_THEME_GIT_PROMPT_PREFIX="<%{$reset_color%}%{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}>" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
PROMPT="%(?..%{$fg[red]%}❌%? %{$reset_color%})💻 %{$fg[cyan]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%} \ | |
💡 %{$fg[yellow]%}%~%{$reset_color%} "'$(git_prompt_info)'" | |
> " | |
RPROMPT="%{$fg[white]%}⏳%*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @deprecated WSL2 Setup | |
# export winip=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}') | |
export winip="sean.mshome.net" | |
# Environment Variable | |
export HTTP_PROXY_PORT=1081 | |
export SOCKS_PROXY_PORT=1080 | |
export DISPLAY=${winip}:0.0 | |
export NIX_PATH=$HOME/.nix-defexpr/channels | |
export NIX_PROFILES='/nix/var/nix/profiles/default $HOME/.nix-profile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was initially generated by Windows Terminal 1.0.1401.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rand_str() { | |
echo $(date +"%Y%m%d%H%M%S")_$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5) | |
} | |
for file in "$@" | |
do | |
file_basename=$(basename "$file") | |
target="/tmp/${file_basename}_$(rand_str)" | |
mv $file $target | |
if [[ $? -ne 0 ]]; then |
OlderNewer