This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/TEMP/Software | |
cd ~/TEMP/Software | |
curl https://ftp.gnu.org/gnu/inetutils/inetutils-1.9.4.tar.xz -O | |
tar -zxvf inetutils-1.9.4.tar.xz | |
cd inetutils-1.9.4 | |
./configure --prefix=/usr/local --disable-servers --disable-hostname \ | |
--disable-ping --disable-ping6 --disable-logger --disable-talk \ | |
--disable-tftp --disable-whois --disable-ifconfig --disable-traceroute | |
make -j8 | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
using System.Collections.Generic; | |
public class Test : MonoBehaviour,IPointerClickHandler ,IPointerDownHandler,IPointerUpHandler | |
{ | |
//监听按下 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feat:新功能(feature) | |
fix:修补bug | |
docs:文档(documentation) | |
style: 格式(不影响代码运行的变动) | |
refactor:重构(即不是新增功能,也不是修改bug的代码变动) | |
test:增加测试 | |
chore:构建过程或辅助工具的变动 | |
============================================================ | |
总共5种提交类型:【新增】【修改】【删除】【优化】【修复】 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyThreadClass | |
{ | |
ManualResetEvent _stopEvent; | |
Thread _thread; | |
public MyThreadClass() | |
{ | |
} | |
public void Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/[Ll]ibrary/ | |
/[Tt]emp/ | |
/[Oo]bj/ | |
/[Bb]uild/ | |
/[Bb]uilds/ | |
/Assets/AssetStoreTools* | |
# Visual Studio 2015 cache directory | |
/.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class ObjectPool<T> where T : class { | |
private readonly Func<T> _objectFactory; | |
private readonly Queue<T> _queue = new Queue<T>(); | |
/// <summary> | |
/// 对象池 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{ | |
// 设置成为当前正在使用的context | |
UIGraphicsBeginImageContext(size); | |
// 绘制改变大小的图片 | |
[img drawInRect:CGRectMake(0, 0, size.width, size.height)]; | |
// 从当前context中创建一个改变大小后的图片 | |
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); | |
// 使当前的context出堆栈 | |
UIGraphicsEndImageContext(); | |
// 返回新的改变大小后的图片 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import <CommonCrypto/CommonDigest.h> // md5需要引用这个文件 | |
// md5 32位 加密 | |
+ (NSString *) MD5:(NSString *) string { | |
const charchar *cStr = [string UTF8String]; | |
unsigned char result[16]; | |
CC_MD5(cStr, strlen(cStr), result); // This is the md5 call | |
//%02x 格式控制: 以十六进制输出,2为指定的输出字段的宽度.如果位数小于2,则左端补0 | |
NSString *output = [NSString stringWithFormat: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UILongPressGestureRecognizer *gs = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(p_gestureRecognizerAction:)]; | |
gs.numberOfTouchesRequired = 1; | |
[self.view addGestureRecognizer:gs]; | |
- (void)p_gestureRecognizerAction:(UIGestureRecognizer *)gestureRecognizer { | |
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { | |
CGPoint touchPoint = [gestureRecognizer locationInView:gestureRecognizer.view]; | |
if(self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { | |
NSString *imgURL = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).src", touchPoint.x, touchPoint.y]; | |
_urlToSave = [self.webview stringByEvaluatingJavaScriptFromString:imgURL]; |
NewerOlder