Skip to content

Instantly share code, notes, and snippets.

View mmun's full-sized avatar

Martin Muñoz mmun

View GitHub Profile
@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) ->
A: Put it in the component's template.
B: component.get('template')?
A: No, component.get('layout').
B: But I though you said template.
A: Layout is the template.
B: What's template?
A: A template!
@mmun
mmun / Readme.md
Last active August 29, 2015 14:17
import Ember from "ember";
import ENV from "./config/environment";
import Router from "./router";
import Resolver from "./resolver";
export default {
create: function() {
window.Cm = createApp(); // Export app global
initGlobals(window.Cm);
{
"name": "client-portal",
"version": "1.0.17",
"description": "Meals portal for Zesty clients",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
import { test } from 'qunit';
import Pretender from 'pretender';
import moduleForAcceptance from 'my-app/tests/helpers/module-for-acceptance';
export function json(status, payload) {
return [
status,
{ 'Content-Type': 'application/json; charset=utf-8' },
JSON.stringify(payload)
];