Skip to content

Instantly share code, notes, and snippets.

var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@codetalks-new
codetalks-new / UIView+PinAutoLayout.swift
Last active February 19, 2020 09:58
简单的AutoLayout封装, 简化80% 的AutoLayout 手写代码
//
// UIView+PinAutoLayout.swift
// banxi1988
// @LastModified 2015/06/12
// Created by banxi1988 on 15/5/28.
// Copyright (c) 2015年 banxi1988. All rights reserved.
//
import UIKit
@bang590
bang590 / linkmap.js
Last active August 19, 2023 15:24
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@tedzhou
tedzhou / 我要学OC:objective-c的内存管理.md
Last active January 29, 2017 07:06
我要学OC:objective-c的内存管理.md

卤煮刚被web大潮淘汰到ios,当听说写oc要手动释放内存的时候如丧考妣,不过幸运的是ARC来了,妈妈再也不用担心我内存泄漏了。不过根据卤煮多年开发经验,和内存相关的不可能没有坑,开心之余还是得了解下oc是怎么搞内存的。

[TOC]

MRR和retainCount

OC对象都有一个属性 retainCount 表明这个对象还有几个引用, 当retainCount为0, 说明这个对象没人用了,runtime就会回收掉。而所谓的内存泄漏就是明明没人用了,retainCount却不是0,runtime没有回收掉这个对象。

retain and release