Skip to content

Instantly share code, notes, and snippets.

View overture8's full-sized avatar

Phil McClure overture8

  • Stora
  • Belfast, Northern Ireland
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play digits="wwwwww1wwwwww6"></Play>
<Gather action="/url">
<Say loop="1000">Please press 1 for customer information</Say>
</Gather>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<DTMF async="false">wwwwww1wwwwww6"></DTMF>
</Response>
@overture8
overture8 / meteor-must-knows.markdown
Last active August 29, 2015 14:09
Meteor - Must knows!
  • Meteor apps, by default, have an insecure package. It's best to keep this in at the start to make development easier but ulltimately this will need to be removed and secure operation need to be added manually.

  • Same with a package called autopublish. This publishs all data up to the clients automatically. Ultimately this needs to be removed and publish/subscribe needs to be managed manually.

  • Meteor Methods can be used to make things more secure. Meteor methods use RPC calls to methods defined on the server. The nice thing is, you also define them on the client. So, when you call a meteor method it executes on the client and the server - the client returns instantly then, once the server returns, if there's a difference, it will patch up the client. (This is latency compensation).

  • As mentioned before, some things are defined on the client, some are defined on the server, and some are defined on the server and the client. It's a bit hard to get you're head around this at the st

@overture8
overture8 / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
map.connect 'archives/:year/:month',
:controller => 'posts',
:action => 'find_by_date',
:year => /\d{4}/,
:month => /(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/
def to_param
"#{id}-#{title.gsub(/[^a-z0-9]+/i, '-')}"
end
class Report
def create_report
# Left blank, sub-classes will implement this
end
end
class XmlReport < Report
def create_report
puts "I am an Xml Report"
end
class ReportGenerator
def print_report(report_type)
report_type.create_report
end
end
user = User.find(1)
user_orders = user.orders
require 'md5'
module CommentsHelper
def gravatar_url_for(email = null, size = 80)
hash = MD5::md5(email.downcase)
image_src = "http://www.gravatar.com/avatar/#{hash}?s=#{size}"
end
end