This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oninput={{ action (action 'valueChanged' additionalParam) value='target.value' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule People do | |
def list(people) do | |
if Kernel.length(people) == 1 do | |
Enum.at(people, 0)[:name] | |
else | |
Enum.map(people, fn person -> person[:name] end) | |
|> Enum.join(", ") | |
|> String.replace(~r/,([^,]+)$/, " &\\1") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users_summary.group_by { |s| s[:user] }.map do |user, value| | |
{ user: user, dailySummary: value.inject(0) { |s, h| s + h[:dailySummary] } } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the id of the author without triggering a request | |
var authorId = post.belongsTo("author").id(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
upstream app { | |
server unix:/var/www/hajsapp/shared/sockets/puma.sock; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pry' | |
require_relative './app/app' | |
Pry.start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const $ = Ember.$; | |
function triggerNativeEvent(element, eventName) { | |
const event = new Event(eventName); | |
element.dispatchEvent(event); | |
} | |
export default function(element, date) { | |
const day = date.getDate(); |
NewerOlder