Skip to content

Instantly share code, notes, and snippets.

View mmun's full-sized avatar

Martin Muñoz mmun

View GitHub Profile
{{yield "header"}}
{{yield}}
@mmun
mmun / gist:10102346
Last active August 29, 2015 13:58 — forked from radar/gist:10101402
# posts/1/comments/1
Blorgh.CommentsNewRoute = Ember.Route.extend
model: ->
post = @modelFor('post')
@store.createRecord('comment', {post})
actions:
save: ->
route = this
@mmun
mmun / gist:10694108
Last active August 29, 2015 13:59 — forked from radar/gist:10693202
<div id='content' {{bind-attr class=':columns showSidebar:twelve:sixteen'}}>
@mmun
mmun / index.hbs
Last active August 29, 2015 14:00 — forked from radar/index.hbs
<h1>Who do you want to know about?</h1>
<p>
{{view EmberStore.NameField person=person}}
</p>
{{#if person}}
<h3>
Here's some info about {{person.first_name}} {{person.last_name}}:
</h3>
<x-foo bar="{{baz}}"></x-foo>
// helpers.WEB_COMPONENT(placeholder, tagName, context, args, hash, helpers);

helpers.WEB_COMPONENT(
  placeholder0,
 "x-foo",
@mmun
mmun / ex.haml
Last active August 29, 2015 14:01
== link_to "Contact us", "pricing", class: "button button-sign-up", :onclick => "_gaq.push(['_trackEvent', 'Sign Up Button', 'Clicked', 'Blog sign up']);"
= link_to "Contact us", "pricing", \
class: "button button-sign-up", \
:onclick => "_gaq.push(['_trackEvent', 'Sign Up Button', 'Clicked', 'Blog sign up']);"
/ Actually, you don't need a \ if the line ends in a comma.
= link_to "Contact us", "pricing",
@mmun
mmun / reload_has_many_links.coffee
Last active August 29, 2015 14:05
reload_has_many_links
@mmun
mmun / math
Last active August 29, 2015 14:07
math
## Problem
Let $b_0 = 1, b_{n+1} = b_n$. What is $b_n \bmod 10^k?$
## Solution (partial)
Let $\varphi_0 = 10^k$ and $\varphi_{n+1} = \varphi(\varphi_n)$.
Let $d_n = \gcd(b, \varphi_n)$ and $t_n = \varphi_n / d_n$.
$b_{n+1} \bmod = b^{b_n} \bmod \varphi_0$
{"1":function(depth0,helpers,partials,data,args) {
var stack1, helper;
data.person = args[0];
return " "
+ this.escapeExpression(((helper = (helper = helpers.greeting || (depth0 != null ? depth0.greeting : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0,{"name":"greeting","hash":{},"data":data}) : helper)))
+ " "
+ this.escapeExpression(this.lambda(((stack1 = (data && data.person)) && stack1.name), depth0))
+ "\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
Cm.SubmissionWorkspaceView = Em.CollectionView.extend
tagName: 'ul'
classNames: [ 'workspace' ]
itemViewClass: 'submissionPage'
didInsertElement: ->
@$().sortable
placeholder: 'placeholder'
start: (e, ui) ->