This file contains hidden or 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
{"status": | |
{"http":"Fetched (late) 200 86400 and parsed 0/1 entries", | |
"code":200, | |
"nextFetch":1430191514, | |
"lastFetch":1430191514, | |
"lastParse":1430105114, | |
"lastMaintenanceAt":1430105114, | |
"period":86400, | |
"feed":"http://techcrunch.com/tag/techlist/feed/"}, | |
"title":"TechCrunch » techlist", |
This file contains hidden or 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 interleave(a, b) | |
return [a, b].transpose.flatten if a.size == b.size | |
if a.size > b.size | |
b << nil | |
else | |
a << nil | |
end | |
[a, b].transpose.flatten.compact |
This file contains hidden or 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
# Create Server Object | |
Server.create(os: 'Windows', ram: 8) | |
# Create Service Object | |
Service.create(type: 'HAD23W', service_id: 1532, ip: '192.168.1.1') | |
# Create Customer Object | |
Customer.create(name:'Cuong Vu', email:'[email protected]') | |
# One service belongs to One server |
This file contains hidden or 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
$('#grid').w2grid({ | |
name: 'grid', | |
show: { | |
lineNumbers: true, | |
footer: true | |
}, | |
recordsPerPage: 100, | |
columns: [ | |
{ field: 'month_report', caption: 'Month', size: '10%', resizable: true, sortable: true }, | |
{ field: 'account_short_name', caption: 'Short Name', size: '15%', resizable: true, |
This file contains hidden or 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
Hello world ! |
This file contains hidden or 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
hello world |
This file contains hidden or 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
<script type="text/javascript"> | |
google.load('visualization', '1.0', {'packages':["imagechart"]}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart() { | |
// Create and populate the data table. | |
var today_electricity_cost = <%= number_with_precision(Calc.today_avg_electricity_cost_of_lighting(@location), :precision => 2) %> | |
var sum_lamp_maint = <%= number_with_precision(Calc.sum_lamp_maint_saving_per_month(@location), :precision => 2) %> | |
var sum_total_savings = <%= number_with_precision(Calc.sum_total_savings_month(@location), :precision => 2) %> | |
var data = google.visualization.arrayToDataTable([ | |
['Today', 'Average monthly electricity cost of lighting ($'+today_electricity_cost+')', 'Average monthly lamp maintenance cost ($'+sum_lamp_maint+')', 'Average monthly cost of ballast mainteance ($'+sum_total_savings+')'], |
This file contains hidden or 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
$('form#new_task').submit(function() { | |
$.ajax({ | |
type: "POST", | |
url: $(this).attr('action'), //sumbits it to the given url of the form | |
data: { | |
data_1: value_1, | |
data_2: value_2 | |
}, //input gui di | |
dataType: "HTML", | |
success(function(result){ |
This file contains hidden or 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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script src="jquery.masonry.min.js" type="text/javascript"></script> | |
<script src="jquery.infinitescroll.min.js" type="text/javascript"></script> // thu vien moi, luu y: xep dang sau masonry.min.js | |
<script type="text/Javascript"> | |
$(document).ready(function () { | |
init(); | |
}); | |
function init() { | |
var $container = $('#container'); | |
$container.imagesLoaded( function(){ |
This file contains hidden or 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
FB.init({ | |
appId : 'YOUR_APP_ID', // App ID | |
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
},{scope:"user_photos"}); |