Skip to content

Instantly share code, notes, and snippets.

@sebyx07
sebyx07 / feed.rss
Created September 7, 2015 21:31
elixirsips
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>Elixir Sips</title>
<link>https://elixirsips.dpdcart.com/</link>
<description/>
<pubDate>Mon, 07 Sep 2015 06:08:00 -0400</pubDate>
<managingEditor>[email protected] (Josh Adams)</managingEditor>
<language>en</language>
<copyright>Copyright 2015 Elixir Sips</copyright>
@sebyx07
sebyx07 / manveru.ex
Last active September 6, 2015 08:51
Enum.map x, fn (el) ->
case el do
{1, 2, 3} ->
#do stuff
{1, 2} ->
#
{a, b, c} ->
# extract stuff
end
end
alias Dota2MatchParser.RequestHelper, as: RequestHelper
alias Dota2MatchParser.MatchHistory, as: MatchHistory
defmodule Dota2MatchParser.MatchHistoryRequest do
use HTTPoison.Base
@url "http://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/V001/"
def get!(params) when is_map(params) do
params_str = RequestHelper.parse_params(params)
@url <> params_str
@sebyx07
sebyx07 / reduce.ex
Created September 5, 2015 22:18
parse query params from map
Enum.reduce params, "?", fn(x, acc) ->
{key, val} = x
acc <> "#{key}=#{val}&"
end
class ContactResource < JSONAPI::Resource
attributes :name_first, :name_last, :email, :twitter
attribute :full_name
def full_name
"#{@model.name_first}, #{@model.name_last}"
end
end
alias git_cop="git diff --name-only --cached -M | grep '\.rb' | xargs rubocop -a --config ./.rubocop.yml"
Consider the network of tramway and bus lines and corresponding stations in different locations in a town. In some places, there exist multiple stations (tramways and buses) in order to allow changing the line. There is an average travel speed and cost associated with each line.
Requirements:
model all the relevant concepts of the problem; appropriately decide on interfaces, abstract classes, classes; consider reusability, data encapsulation, separation of concerns; PROVIDE A CLASS DIAGRAM;
supposing a person wants to go from one particular place to another, provide him/her with ALL the available connections (do not consider the schedule constraints);
have the system providing the fastest, shortest and the cheapest way to go from a location to another;
simulate the travel of the person by displaying the station names and waiting between two station based on the average speed on the current line.
Value: 3p
Deadline: November 23th, 2014, 23:59. Missing the deadline up to one week decrease the value of the proj
post = Post.find(params[:id])
render json: JSONAPI::ResourceSerializer.new(PostResource).serialize_to_hash(PostResource.new(post)), status: :success
{
"name": "crewmeister",
"dependencies": {
"ember": "1.13.6",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.13.7",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
create_table "crew_logs", force: true do |t|
t.integer "crew_id"
t.integer "creator_id"
t.integer "action_type" # to find the class name through a translator and more details about the action
t.integer "action_id"
t.datetime "updated_at"
end