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
curl -s http://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/ | |
alias composer='/usr/local/bin/composer.phar' |
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
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) | |
{ | |
try | |
{ | |
int icolumn = dgvCart.CurrentCell.ColumnIndex; | |
int irow = dgvCart.CurrentCell.RowIndex; | |
if (keyData == Keys.Enter) | |
{ | |
if (icolumn == dgvCart.Columns.Count - 1) |
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
function dynamicSort(property) { | |
var sortOrder = 1; | |
if(property[0] === "-") { | |
sortOrder = -1; | |
property = property.substr(1); | |
} | |
return function (a,b) { | |
var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; | |
return result * sortOrder; | |
} |
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
// Hacking javascript to get the week number of a selected date | |
Date.prototype.getWeek = function() { | |
var date = new Date(this.getTime()); | |
date.setHours(0, 0, 0, 0); | |
// Thursday in current week decides the year. | |
date.setDate(date.getDate() + 3 - (date.getDay() + 7) % 7); | |
// January 4 is always in week 1. | |
var week1 = new Date(date.getFullYear(), 0, 4); | |
// Adjust to Thursday in week 1 and count number of weeks from date to week1. | |
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 |
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
$.ajax({ | |
url: 'http://127.0.0.1:5984/insightout/_all_docs?include_docs=true&limit=25', | |
type: 'GET', | |
success: function(result) { | |
var result = JSON.parse(result); | |
for(var i = 0; i<result.rows.length; i++) { | |
if(result.rows[i].doc.type == 'DeviceReading') { | |
//console.log(result.rows[i].doc._id) | |
$.ajax({ | |
url: 'http://127.0.0.1:5984/insightout/_design/update_readings/_update/in-place-query/' + result.rows[i].doc._id + '?field=couchDbId&value=19fc40f327d2a154a1c6288089cb7579', |
NewerOlder