Skip to content

Instantly share code, notes, and snippets.

View welsonla's full-sized avatar
💬
I may be slow to respond.

welsonla welsonla

💬
I may be slow to respond.
View GitHub Profile
@welsonla
welsonla / left-align-stack-view.png
Created May 21, 2022 09:13 — forked from morishin/left-align-stack-view.png
Align to Left the contents of UIStackView
left-align-stack-view.png
@welsonla
welsonla / snapshots_clear.rb
Last active January 1, 2020 08:48
清理本地磁盘快照
#/bin/bash
#diskspace info
puts "Current Diskspace info:"
puts "---------"
puts %x[df -lh /]
#list localsnapshots
puts "\n\n---------"
list = %x[tmutil listlocalsnapshots /]

Keybase proof

I hereby claim:

  • I am welsonla on github.
  • I am welsonla (https://keybase.io/welsonla) on keybase.
  • I have a public key ASA062wB0lIaDtYXOlIQJELGJYB-xWHbzq3-XeGLZJnGOQo

To claim this, I am signing this object:

{"sig":"bae0a82e3cf26d806dda771ededee3444576fd474eca302db6749083be8f19275453f4f54de488021c08d2c17f79cfae4774c06f7b5c2d14e16b6652269722fe1","msghash":"9dfc8ce4bc3d0fb4023adbcaee1b630c2cd25e66611b833056821fae69dcffe9"}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
#
# Update 2013-06-24: added -w0 option to prevent truncated lines
require 'base64'
data=`ioreg -l -w0 -d0 -r -c AppleDisplay`
textvie auto scroll to last line
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range
replacementText:(NSString *)text
{
if ([text isEqualToString:@"\n"]) { //按下return键
NSLog(@"%f",textView.contentSize.height);
if (textView.contentSize.height>contentText.frame.size.height) {
[textView scrollRangeToVisible:range];
//使用原生的Object-c调用
#import <sqlite3.h>
...
NSString *databasePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
stringByAppendingPathComponent: @"sqlcipher.db"];
sqlite3 *db;
if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
const char* key = [@"BIGSecret" UTF8String];
sqlite3_key(db, key, strlen(key));
SSH
ssh [email protected]
Tail files
rhc-tail-files -a autoworker
rhc app show -a autoworker
#清理SVN目录
find . -type d -name ".svn"|xargs rm -rf
#统计代码行数
find . -name '*.h' -o -name '*.m' | xargs wc -l
3折
重构改善既有代码的设计 68 0.8 http://product.dangdang.com/product.aspx?product_id=8695773
应用框架的设计与实现(.Net平台) 39.8 9 http://product.dangdang.com/product.aspx?product_id=9025485
重构与模式 45 9 http://product.dangdang.com/product.aspx?product_id=9228791
分析模式 48 9 http://product.dangdang.com/product.aspx?product_id=7401690
领域驱动设计 48 9 http://product.dangdang.com/product.aspx?product_id=9150450
游戏设计基础 69 9 http://product.dangdang.com/product.aspx?product_id=20470880
游戏设计概论 38 9 http://product.dangdang.com/product.aspx?product_id=20196642
游戏开发核心技术——剧本和角色创造 49 9 http://product.dangdang.com/product.aspx?product_id=9322839
游戏设计完全教程 138 8.5 http://product.dangdang.com/product.aspx?product_id=20149434