Skip to content

Instantly share code, notes, and snippets.

View Mongey's full-sized avatar

Conor Mongey Mongey

View GitHub Profile
data State = State {
header :: Row,
records ::[Row],
filename::String,
modified::Bool
} deriving Show
data Row = Row {
contents::[String]
} deriving Show
load filename = do
handle <- openFile filename ReadMode
contents <- hGetContents handle
let unparsed = splitlines contents "" []
let result = myRow unparsed []
let the_state = State{
spreadsheet = result,
filename = filename,
modified = True
}
for(int i=1; i<this.tags.length;i++){
if(this.tags[i-1]==null && this.tags[i]!=null){
this.tags[i-1] = this.tags[i];
}
}
Traceback (most recent call last):
File "/Users/conormongey/NBZ/SickBeard/cherrypy/_cprequest.py", line 660, in respond
response.body = self.handler()
File "/Users/conormongey/NBZ/SickBeard/cherrypy/lib/encoding.py", line 193, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/Users/conormongey/NBZ/SickBeard/cherrypy/_cpdispatch.py", line 25, in __call__
return self.callable(*self.args, **self.kwargs)
File "/Users/conormongey/NBZ/SickBeard/sickbeard/webserve.py", line 2353, in setStatus
logger.log(u"Sending backlog for "+showObj.name+" season "+str(cur_segment)+" because some eps were set to wanted")
File "/Users/conormongey/NBZ/SickBeard/sickbeard/logger.py", line 179, in log
def calculate_totals
@sub_total = 0
@vat_total = 0
@total = 0
self.line_items.each do |line|
@total = @total + line.total
@sub_total = @sub_total + line.subtotal
@vat_total = @vat_total + ( line.total - line.subtotal)
end
self.sub_total = @sub_total
footer .privacy {
font: 10px/1.2em Arial, Helvetica, sans-serif;
color: white;
margin: 20px 0;
text-align: center;
}
<%= form_for LineItem.new, :remote => true do |f| %>
<div class="field">
<%= f.label :part_id %><br />
<%= f.select("part_id", Part.all.collect {|c| [ c.name, c.id ] })%>
</div>
<div class="field">
<%= f.hidden_field :invoice_id, :value => @invoice.id %>
</div>
import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
urlForUpdateRecord: function(store, type, snapshot) {
let delta = snapshot.get('rotation_delta')
if(delta != 0){
return 'http://localhost:3000/images/' + snapshot.get('id') + '/rotate';
}
return this._super(store,type,snapshot);
App.derpyodo = Ember.Component.extend({
loading: true,
willInsertElement: function(){
var user_id = this.get('user-id');
var self = this;
Ember.$.ajax({
url: 'http://localhost:3000/v2/accounts/%@'.fmt(user_id),
}).then(function(resolve) {
self.set('amount', amount);
});
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.006 000.006: --- VIM STARTING ---
000.074 000.068: Allocated generic buffers
000.345 000.271: locale set
000.348 000.003: clipboard setup