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
/\s+/.test('aaa bbb') |
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
while (arr = arr.shift()) { | |
} |
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 JSONP_API = {}; | |
function loadJS(src){ | |
var script = document.createElement('script'); | |
script.src = src; | |
var body = document.body; | |
body.appendChild(script); | |
} | |
JSONP_API.callback1 = function(data){ |
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 onFileSelect = function(ev){ | |
var file = ev.target.files[0]; | |
var reader = new FileReader(); | |
reader.readAsText(file, 'UTF-8'); | |
reader.onload = function(ev){ | |
var i, l; | |
var txt = ev.target.result; | |
var lines = txt.split(/\r\n/); | |
for( i = 0, l= lines.length; i < l; 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
unless /\A-?\d+\Z/ =~ num |
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
('a'..'z').to_a.shuffle[0..7].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
File.expand_path("../../config/environment", __FILE__) |
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
mysql -uroot -h127.0.0.1 dbname -e'show tables;' |
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
SHOW VARIABLES like '%time_zone%'; | |
SET GLOBAL time_zone = '+9:00'; |
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
respond_to do |format| | |
if @magazine.save | |
format.html { redirect_to @magazine, notice: 'Magazine was successfully created.' } | |
format.json { render json: @magazine, status: :created, location: @magazine } | |
else | |
format.html { render action: "new" } | |
format.json { render json: @magazine.errors, status: :unprocessable_entity } | |
end | |
end | |
OlderNewer