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 <Foundation/Foundation.h> | |
@interface Communicator : NSObject <NSStreamDelegate> { | |
@public | |
NSString *host; | |
int port; | |
} | |
- (void)setup; |
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
#!/usr/bin/env python | |
""" | |
* Writing By Luavis | |
""" | |
# -*- coding:utf-8 -*- | |
import time | |
def date(): | |
print (time.strftime("%H:%M:%S")) |
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
'use strict'; | |
var request = require('request') | |
setInterval(function() { | |
request.get('http://m.search.naver.com/search.naver?query=%ED%95%9C%EA%B5%AD%EB%94%94%EC%A7%80%ED%84%B8%EB%AF%B8%EB%94%94%EC%96%B4%EA%B3%A0%EB%93%B1%ED%95%99%EA%B5%90+%EC%84%A0%EC%83%9D%EB%8B%98+%EC%82%AC%EB%9E%91%ED%95%B4%EC%9A%94&where=m&sm=fbk_pin&og_title=%5B%EB%84%A4%EC%9D%B4%EB%B2%84%5D+%EA%B2%80%EC%83%89%3A+%22%ED%95%9C%EA%B5%AD%EB%94%94%EC%A7%80%ED%84%B8%EB%AF%B8%EB%94%94%EC%96%B4%EA%B3%A0%EB%93%B1%ED%95%99%EA%B5%90+%EC%84%A0%EC%83%9D%EB%8B%98+%EC%82%AC%EB%9E%91%ED%95%B4%EC%9A%94%22+%EB%82%B4%EA%B0%80+4063%EB%93%B1%21+%282014.5.15%29+%EB%82%98%EB%8A%94+%EB%AA%87+%EB%93%B1%EC%9D%BC%EA%B9%8C%3F'); | |
}, 30000); |
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
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
#define UIColorFromRGBWithAlpha(rgbValue, alpha) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:alpha] | |
#define UINavigationBarTintColor(uicolor) \ | |
NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; \ | |
if ([[ver objectAtIndex:0] intValue] >= 7) { \ | |
self.navigationController.navigationBar.barTintColor = uicolor; \ | |
self.navigationController.navigationBar.translucent = NO; \ | |
} else { \ | |
self.navigationController.navigationBar.tintColor = uicolor; \ |
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
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch | |
git config --global core.excludesfile ~/.gitignore | |
echo .DS_Store >> ~/.gitignore |
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
ACAccountStore *accountStore = [[ACAccountStore alloc] init]; | |
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; | |
id options = @{ | |
ACFacebookAppIdKey: @"403376439767549", | |
ACFacebookPermissionsKey: @[ @"email", @"read_friendlists"], | |
ACFacebookAudienceKey: ACFacebookAudienceFriends | |
}; | |
[accountStore requestAccessToAccountsWithType:facebookAccountType | |
options:options | |
completion:^(BOOL granted, NSError *error) { |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pycaption import SAMIReader, SRTWriter | |
import sys | |
import os | |
from chardet.universaldetector import UniversalDetector | |
def main(): | |
if len(sys.argv) < 1: |
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 Foundation | |
class TestArray { | |
private var array:Array<String> = ["asd", "asdf", "asdfg"] | |
subscript(index: Int) -> String { get { | |
return self.array[index] | |
}} | |
} |
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
#!/bin/sh | |
# change screenshot save folder at ~/Screenshots | |
mkdir -p ~/Screenshots/ | |
defaults write com.apple.screencapture location ~/Screenshots/ | |
killall SystemUIServer |
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
$ tcpdump -qns 0 -A -r ./tcp-transfer-0-0.pcap | |
reading from file ./tcp-transfer-0-0.pcap, link-type PPP (PPP) | |
09:00:00.000000 IP 10.1.3.1.49153 > 10.1.3.2.80: tcp 0 | |
.!E..8....@... | |
... | |
......P.................... | |
........... | |
09:00:00.020079 IP 10.1.3.2.80 > 10.1.3.1.49153: tcp 0 | |
.!E..(....@... | |
... |
OlderNewer