Skip to content

Instantly share code, notes, and snippets.

View luckydrq's full-sized avatar

Deng Ruoqi luckydrq

View GitHub Profile
@3rd-Eden
3rd-Eden / README.md
Last active January 4, 2021 10:20
Protecting against POODLE in node.js

[Google recently announced][poodle] that there is an exploit in SSLv3, this vulnerability is know as POODLE. There is no other option than to disable SSLv3 in order to combat this major flaw. There have already been [guides on how to disable this in different servers][guides]. But nothing excised for Node.js yet, until now. In order to resolve this for Node.js we need to use various of undocumented options and modules.

In the index.js file below you can see an example of how you can protect your HTTPS server against the POODLE attack. It uses the secureOptions option to pass in constants in to the SSL context which is created by node.

@dead-horse
dead-horse / bench.js
Created August 23, 2014 16:20
co benchmark for thunk and promise
var benchmarks = require('beautify-benchmark');
var Benchmark = require('benchmark');
var thunkify = require('thunkify');
var zlib = require('zlib');
var co = require('co');
var fs = require('fs');
var gzipPromise = require('mz/zlib').gzip;
var gzipThunk = thunkify(zlib.gzip);
var fsPromise = require('mz/fs');
@yisibl
yisibl / prefix.css
Last active August 29, 2015 13:56
Autoprefixer 测试用例
/**
* Autoprefixer 测试用例
* @author: 一丝
* @update: 2014-2-21 11:26:44;
*/
/* ==========================================================================
常用属性测试
========================================================================== */
@yisibl
yisibl / git-optimization.md
Last active June 28, 2023 14:59
Git 优化

Git 优化

在前两节中,我们安装完Git后,创建并备份了公钥,这篇教程让我们在使用 Git 时更加得心应手。

优化点

  • 解决各种Git下的中文问题
  • 显示中文文件夹或文件
  • 显示中文git log信息
  • 支持直接在bash输入中文
@yisibl
yisibl / HTML-tags.md
Last active September 15, 2024 14:09
常用的 HTML 头部标签

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
@wolfeidau
wolfeidau / pi-build-deb.sh
Last active August 18, 2021 07:05
Build nodejs from source and assemble a deb package which installs on the Raspberry pi
#!/bin/bash
set -e
set -o errtrace
node_version="0.10.20"
source_bundle="http://nodejs.org/dist/v${node_version}/node-v${node_version}.tar.gz"
# store the location of the base working area.
@fcicq
fcicq / smartmachine-survival-guide-fcicq.markdown
Last active December 11, 2015 06:48
SmartMachine 生存指南 by fcicq

SmartMachine 生存指南

by fcicq, CC-BY

SmartMachine 是 Joyent 家的虚拟化方案.
SmartOS 主要的卖点是 ZFS + DTrace + Zones (SmartMachine) + KVM (运行 Linux, Windows 等).
实际上 SmartOS 是 Joyent 以 Solaris 为基础 (因为 OpenSolaris 项目被中止而改名 illumos) 打包的操作系统.

SmartOS 作为 HOST 时, 虽然支持 KVM 虚拟化, 但不支持突发的 vCPU.
而 SmartMachine 是基于 Zones 的 (存储则是 ZFS), 比较类似 Linux 平台下 OpenVZ 或者 LXC 的方案.
资源用量由调度器决定, 只需要修改配额 (ZFS 也支持在线扩展) 就可以伸缩, 所以伸缩不需要重启.

@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active November 18, 2024 09:05
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.