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
#include <QtCore/QCoreApplication> | |
#include <crypto++/des.h> | |
#include <stdio.h> | |
// keyString 是一个密钥,必须保证长度要超过 16 | |
// block 是要处理的数据,处理后的数据也同时存放在 block 里,必须保证它的长度为 8 的整倍数 | |
// length 是 block 的长度,必须保证它为 8 的整倍数 | |
// direction 是表示是否是加密还是解密,若是加密,则用 CryptoPP::ENCRYPTION, 解密用 CryptoPP::DECRYPTION |
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
require 'socket' # Sockets are in standard library | |
hostname = 'www.3-kingdoms.com' | |
port = 2000 | |
s = TCPSocket.open(hostname, port) | |
while line = s.gets # Read lines from the socket | |
puts line.chop # And print with platform line terminator | |
end |
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
-(void)disableReturnKey{ | |
// Locate non-UIWindow. | |
UIWindow *keyboardWindow = nil; | |
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { | |
if (![[testWindow class] isEqual:[UIWindow class]]) { | |
keyboardWindow = testWindow; | |
break; | |
} | |
} | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- default ordered fallback list - fallback entity has to be PostScript name --> | |
<key>default</key> | |
<array> | |
<string>LucidaGrande</string> <!-- MAKE sure this matches the kCTFontSystemFontType in CTFontDescriptorCreateForUIType() & TDescriptorSourceImp::CreateDefaultDescriptor()! --> | |
<string>AppleSymbolsFB</string> | |
<string>GeezaPro</string> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fmod.h> | |
int main(void) | |
{ | |
FILE *fp = fopen("win-cc.ogg", "rb"); | |
fseek(fp, 0, SEEK_END); | |
int length = ftell(fp); |
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
# put the following code to ~/.config/fish/config.fish | |
set --export PATH $PATH "The path you want to append" |
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
NSError *error; | |
NSURL *ipURL = [NSURL URLWithString:@"http://automation.whatismyip.com/n09230945.asp"]; | |
NSString *ip = [NSString stringWithContentsOfURL:ipURL encoding:NSUTF8StringEncoding error:&error]; | |
NSLog(@"IP:%@",ip); |
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
#pragma GCC push | |
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |
static ABAddressBookRef CreateAddressBook(){ | |
if (ABAddressBookCreateWithOptions != NULL) { | |
return ABAddressBookCreateWithOptions(NULL, NULL); | |
}else{ | |
return ABAddressBookCreate(); | |
} | |
} |
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
tell application "Mail" | |
set theSubject to "Subject" -- the subject | |
set theContent to "Content" -- the content | |
set theAddress to "xxx@163.com" -- the receiver | |
set theSignatureName to "signature_name"-- the signature name | |
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} |
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
Filter = { | |
Bundles = (com.apple.MobileSMS); | |
}; |
OlderNewer