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
# TODO : redirect link 호출 및 text data 긁어오기 | |
require 'net/http' | |
require 'nokogiri' | |
require 'sanitize' | |
@newsfeed = Newsfeed.new | |
//... | |
@newsfeed.link = "http://openapi.naver.com/l?AAAD2M2w6DIAxAv6Y+GgRl8uCD29xvLFjKNFNwyC7+/TBZljTNOSdpH08KWwPdEdoKVA3ded91Cd0J2kOCLG4LNY7ea3anrVGWS131CpU10khkJRqtLdNYUU1SZEMg2wwxLiBa4Jc06+JDXPP9Re70i0KOfv73BKMz9Mnd4EBcUEe6+bCBOM9TD1xivCXej5PM3iQJpE0Sb+2IdB33VBSHVHSII06/xBjjouRKqS+DV2bW5AAAAA==" | |
response = Net::HTTP.get_response(URI.parse(@newsfeed.link)) | |
response_redirect = Net::HTTP.get_response(URI.parse(response['location'])) |
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
//JSON example | |
// - receiedData : {"feed" : {"title" : "my title", "content" : "my content"}} 인 경우 | |
- (void) startJsonParse(NSData *receivedData) | |
{ | |
NSError* error; | |
NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:receivedData options:kNilOptionserror:&error]; | |
NSArray *array = [[dictionary objectForKey:@"feed"] objectForKey:@"entry"]; | |
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
public class CreditCardValidation { | |
public static void main (String[] args) { | |
if (args.length < 1) { | |
System.out.println("usage: CreditCardValidation number"); | |
} else { | |
String cardNumber = args[0]; | |
int checksum = 0; | |
int length = cardNumber.length(); | |
for (int i = 0; i < length; i++) { |
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
public class Cynap { | |
private static final int BASE = 26; | |
public static void main(String[] args) { | |
if (args.length < 1) { | |
System.out.println("please insert value... "); | |
return; | |
} | |
System.out.println("input: " + args[0]); |
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/env/python | |
# coding: utf8 | |
import urllib | |
import urllib2 | |
import requests | |
from datetime import date, datetime | |
## urllib는 파일 만들고 다운로드 + write 시작 | |
## urllib2 다운로드 받은 후에 파일 write 시작 | |
url = 'http://www.poombuy.com/sk_styletag/sk_stt_all.xml' |
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
# for mac, remove comment. | |
#export LC_CTYPE=C | |
#export LANG=C | |
find . -type f -exec sed -i '' 's/SRC/DST/g' {} \; |
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
#https://gist.github.com/rajraj/1556657 | |
sudo yum update | |
sudo yum install java-1.7.0-openjdk.i686 -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
mv elasticsearch-* elasticsearch |
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
var mysql = require('mysql'); | |
var fs = require('fs'); | |
var properties = require('./db-properties.json'); | |
var env = require('./env.json'); | |
var connection = mysql.createConnection(properties); | |
var filename = env.query_result_filename; | |
var surveyIds = []; | |
connection.query("use database"); |
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
var exec = require('child_process'), | |
fs = require('fs'), | |
readline = require('readline') | |
stream = require('stream'), | |
AWS = require('aws-sdk'), | |
domain = require('domain'), | |
crypto = require('crypto') | |
var env = require('./env.json') | |
var instream = fs.createReadStream(env.query_result_filename); |
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
var exec = require('child_process'), | |
mysql = require('mysql'), | |
fs = require('fs'), | |
readline = require('readline') | |
stream = require('stream'), | |
AWS = require('aws-sdk'), | |
domain = require('domain'), | |
crypto = require('crypto') | |
var env = require('./env.json') |
OlderNewer