Skip to content

Instantly share code, notes, and snippets.

View zhangshine's full-sized avatar
🎯
Focusing

ZhangShine zhangshine

🎯
Focusing
View GitHub Profile
@zhangshine
zhangshine / Start-Static-Server.scpt
Last active May 7, 2023 02:10
macOSX - Automator - Quick Action - Run AppleScript - To start a static server on folder and open it with the default browser
tell application "Finder"
set currentFolder to (folder of the front window) as alias
end tell
set posixPath to POSIX path of currentFolder
tell application "Terminal"
activate
do script "cd " & quoted form of posixPath & "; python3 -m http.server"
end tell
@zhangshine
zhangshine / sojson.v5.decrypt.js
Last active June 26, 2024 08:03
sojson.v5 解密
// 用法 console.log(decrypt(加密的js内容))
// console里面输出的内容就是解密后的内容,解密后的内容里面仍然含有 _0xXXXX 这样的混淆后的字符串, 需要一点点进行重命名
// 下面的代码以前从网上找的,已经找不到出处了。。。
function decrypt(js_body) {
// 脱壳 && 解密
let js_arr = js_body.split("\n").pop().split(';'),
fun_name = /var\s+(_0x[a-z0-9]+)=/.exec(js_arr[6])[1],
reg_str = fun_name + '\\(' + "'([^']+)',\s*'([^']+)'" + '\\)',
js_str = js_arr.slice(54, js_arr.length - 4).join(' ;'),
@zhangshine
zhangshine / tinymce-react-nextjs.md
Last active July 4, 2024 16:02
NextJs- React - Self hosted TinyMCE
  1. Install (TinyMCE 5.x)
npm install --save tinymce @tinymce/tinymce-react copy-webpack-plugin
  1. Copy static files(tinymce skins) to public folder. Edit file next.config.js
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
@zhangshine
zhangshine / nginx.conf
Last active August 29, 2015 14:25 — forked from nl5887/nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log debug;
#pid logs/nginx.pid;
daemon off;
@zhangshine
zhangshine / zhangshine.zsh-theme
Last active August 29, 2015 14:21
zhangshine.zsh-theme
PROMPT=$'%{$fg[green]%}%n@%~ %D{%a %b %d %X} %{$reset_color%} $(git_prompt_info)\
%{$fg[green]%}>%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@zhangshine
zhangshine / marshal.rb
Created September 22, 2014 09:34
gems index
m = Marshal.load(Gem.gunzip(File.read("latest_specs.4.8.gz")))
m.each do |specs|
#specs = m[2]
print specs[0]
print '('
print specs[1].version
print ')'
puts
end
@zhangshine
zhangshine / clean.sh
Last active August 29, 2015 14:03
clean pyc and local_settings
cd $(dirname $0)
find -name local_settings.py* | xargs rm
find -name *.pyc | xargs rm