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
if ARGV[0] != nil | |
originFile = ARGV[0] | |
contentsArray = IO.readlines(originFile) | |
currentTime = Time.now.strftime("%Y-%m-%d-%H-%M-%S") | |
targetFile = "#{ARGV[0]}_#{currentTime}.txt" | |
resultFile = File.open(targetFile, "w") | |
contentsArray.each do |line| | |
if (line =~ /JAVA/) | |
resultFile.write(line) |
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
<!DOCTYPE html> | |
<html ng-app="myApp"> | |
<head> | |
<title>AngularJS</title> | |
</head> | |
<body> | |
<div> | |
<div ng-controller="MainCtrl"> | |
<p ng-model="helloworld">{{ helloworld }}</p> | |
</div> |
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 'date' | |
current_time = DateTime.now | |
current_time = current_time.strftime "%d/%m/%Y_%H_%M" | |
current_time = current_time.gsub(/[ :]/,'_') | |
current_time = current_time.gsub(/[ \/]/,'_') | |
somefile = File.open("result-#{current_time}.txt", "w") | |
# if you need change sourcefile name then below timestamp.txt to "yourfilename" | |
File.open("timestamp.txt") do |file| | |
file.each do |line| |
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
<head> | |
<title>fabricjs</title> | |
<script src="fabric.js"></script> | |
</head> | |
<body> | |
<h1>Fabric</h1> | |
{{> main}} | |
</body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.5.1/ember.js"></script> |
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
// Point | |
var Point = (function() { | |
'use strict'; | |
function Point(x, y) { | |
var x; | |
var y; | |
if (!(this instanceof Point)) { | |
return new Point(x, y); | |
} |
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
package; | |
import flixel.FlxG; | |
import flixel.FlxState; | |
import flixel.addons.weapon.FlxBullet; | |
import flixel.addons.weapon.FlxWeapon; | |
import flixel.util.FlxColor; | |
/** | |
* A FlxState which can be used for the actual gameplay. |
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
# encoding: utf-8 | |
lines=File.readlines("oliver.txt") | |
line_count=lines.size | |
text=lines.join | |
total_character=text.length | |
total_character_no_whitespace=text.gsub(/\s+/,'').length | |
word_count=text.split.length | |
paragraph_count=text.split(/\n\n/).length | |
sentence_count=text.split(/\.|\!|\?/).length | |
puts "전체 길이 : #{line_count}" |
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
# encoding: utf-8 | |
# Stop_words 2012-12-26 | |
stop_words = %w{the a by on for of are with just but and to the my I has some in} | |
text=%q{Korea is officially the only divided nation in the world.} | |
words = text.scan(/\w+/) | |
key_words = words.select { |word| !stop_words.include?(word)} | |
puts "문장 중 키워드의 비율은 : #{((key_words.length.to_f/words.length.to_f)*100).to_i}%" | |
puts key_words.join(' ') |
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
def current_user | |
@current_user ||= User.find(session[:user_id]) | |
end |
OlderNewer