Skip to content

Instantly share code, notes, and snippets.

@nailuoGG
nailuoGG / BigDecimal.js
Created November 24, 2017 01:32 — forked from xinlc/BigDecimal.js
JavaScript高精度计算
//除法函数,用来得到精确的除法结果
//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
//调用:accDiv(arg1,arg2)
//返回值:arg1除以arg2的精确结果
function accDiv(arg1, arg2) {
var t1 = 0,
t2 = 0,
r1, r2;
try {
t1 = arg1.toString().split(".")[1].length
@nailuoGG
nailuoGG / Crypter.java
Created April 18, 2017 02:06 — forked from flying19880517/Crypter.java
QQ的TEA加密
package mobi.bbase.ahome.utils;
import java.io.ByteArrayOutputStream;
import java.util.Random;
/**
* 加密解密QQ消息的工具类. QQ消息的加密算法是一个16次的迭代过程,并且是反馈的,每一个加密单元是8字节,输出也是8字节,密钥是16字节
* 我们以prePlain表示前一个明文块,plain表示当前明文块,crypt表示当前明文块加密得到的密文块,preCrypt表示前一个密文块
* f表示加密算法,d表示解密算法 那么从plain得到crypt的过程是: crypt = f(plain ˆ preCrypt) ˆ
#!/usr/local/bin/tmux
# vim: syntax=tmux
# set 2nd bind key (like screen)
set -g prefix2 C-a
#
bind C-b last-window
# reload config
@nailuoGG
nailuoGG / gist:56a0a92ee92f6a92513eed3388fd99a6
Created December 8, 2016 08:18 — forked from lucifr/gist:1208100
Sublime Text 2 - 实用快捷键 (Mac OS X)
@nailuoGG
nailuoGG / letsencrypt_notes.sh
Created November 23, 2016 10:38 — forked from lachesis/letsencrypt_notes.sh
Set up LetsEncrypt using acme.sh without root
# How to use "acme.sh" to set up Lets Encrypt without root permissions
# See https://github.com/Neilpang/acme.sh for more
# This assumes that your website has a webroot at "/var/www/<domain>"
# I'll use the domain "EXAMPLE.com" as an example
# When this is done, there will be an "acme" user that handles issuing,
# updating, and installing certificates. This account will have the following
# (fairly minimal) permissions:
# - Host files at http://EXAMPLE.com/.well-known/acme-challenge
整合了可以搜索到的列表,有广告过滤等,自行添加Proxy信息即可使用。
目前使用无恙。
不定期更新。
感谢各位分享者。
@nailuoGG
nailuoGG / README.md
Created January 7, 2016 06:14 — forked from raecoo/README.md
Surge config

Install Configurations

  1. Create your own start.conf:
  2. Download rules.conf
  3. Tap start.conf in the configuration list, then tap Start button.

Update Rules

@nailuoGG
nailuoGG / git_toturial
Last active August 29, 2015 14:27 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@nailuoGG
nailuoGG / css_resources.md
Last active August 29, 2015 14:25 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@nailuoGG
nailuoGG / python_resources.md
Last active August 29, 2015 14:25 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides