Skip to content

Instantly share code, notes, and snippets.

module.exports = (args) ->
_get_callback = (args, pos) ->
if args.length > pos - 1
candidate = args[args.length-pos]
if candidate && typeof candidate == 'function'
candidate
win = ->
fail = ->
if candidate = _get_callback args, 1
https = require 'https'
module.exports.request = ( options, success_handler, error_handler) ->
req_data = if options.data? then JSON.stringify options.data else ""
options['headers']['Content-length'] = req_data.length
req = https.request options, (res) ->
data = ''
res.on 'data', (c) ->
data += c
## this
for j in arr
alert i for i in j
## or this
for j in arr
for i in j
alert i
@smathy
smathy / gist:1355922
Created November 10, 2011 19:39
Instructions
1. Login to the web interface at: http://mail.amcoonline.net/
2. Go to "Settings"
3. Click on the "Accounts" tab.
4. In the "Send mail as:" block click "Add another email address you own"
5. Type your same username but @amco.me in the "Email address" field, so for [email protected] you will type [email protected]
6. Click the "Next Step" button.
7. Leave the "Send through International Education Services, Inc. Mail (easier to set up)" option selected and click the "Next Step" button.
8. Click the "Send Verification" button.
9. You can close this window now (yes, even though it has a place to enter the verification code, you won't need it).
10. Wait for the email to arrive in your Inbox.
p ->
a href: "/foo/bar" -> "Text for link"
"Text in between"
a href: "/oink" -> "Text for second link"
in_foobar_queue = (queue_array) ->
ret = false
queue_array.each (queue_id) ->
queue_name = http.get("http://foo.com/queue/#{queue_id}").name
if queue_name == 'foobar'
ret = true
break
return ret
ticket = http.get('http://foo.com/ticket/45')
.cart_title = t('.title')
%table
= render(cart.line_items)
%tr.total_line
%td{:colspan => "2"} Total
%td.total_cell= number_to_currency(cart.total_price)
= button_to t('.checkout'), new_order_path, method: :get
= button_to t('.empty'), cart, method: :delete, confirm: 'Are you sure?'
aw_ciudad
aw_escuela
aw_escuelaid
aw_pais
carrito_$tipo
cliente_escuelaid
clienteid
clipboard_objectiveid
equipo
failed
app/controllers/application_controller.rb:29: session[:php] = {}
app/controllers/application_controller.rb:33: session[:php][ k.to_sym ] = v
app/controllers/application_controller.rb:39: session[:php] ||= {}
app/controllers/application_controller.rb:50: ret = session[:php].clone
app/controllers/application_controller.rb:70: session[:php].present? and session[:php][:usuarioid].present? and session[:php][:seccion] == 'extranet'
app/controllers/application_controller.rb:94: @current_legacy_user ||= LegacyUser.find session[:php][:usuarioid]
app/controllers/application_controller.rb:102: @current_client ||= Client.find session[:php][:clienteid] if session[:php][:clienteid]
app/controllers/application_controller.rb:215: return nil unless session[:php].present? and session[:php][:tipo].present?
app/controllers/application_controller.rb:216: session[:php][:tipo].to_sym
app/controllers/course_controller.rb:66: School.school_scope( is_school?, session[:php][:escuelaid] )