I hereby claim:
- I am joshualcoffee on github.
- I am jcoffee (https://keybase.io/jcoffee) on keybase.
- I have a public key whose fingerprint is CD80 91A1 EB6A 9C74 646D 41A0 FF4D 5558 FA6C 6316
To claim this, I am signing this object:
def scrape_images(url) | |
doc = Nokogiri::HTML(open(url)) | |
url = url.slice( /\A(http|https)(:\/\/){1}[a-z0-9\-\.]{1,}/i ) | |
images = [] | |
doc.css("img").each do |img| | |
img = img['src'] | |
if img =~ /\A\/.*/ | |
src = url + img | |
# Check for complete link |
$scope.buildPagination = () -> | |
c = $scope.current_page | |
padded = $scope.pagination_padding*2 | |
arr = [] | |
if c <= $scope.total_pages | |
min = c - $scope.pagination_padding | |
max = c + $scope.pagination_padding | |
show_next = true |
calculate_summary = ($el) -> | |
$cells = $("td", $el) | |
$cells.each (i, v) -> | |
val = parseInt($(this).text()) | |
int = if isNaN(val) then 0 else val | |
if !sums[i]? | |
sums[i] = 0 | |
sums[i] = sums[i] + int | |
return sums | |
$ -> |
@today_tasks = @incomplete_tasks.where('scheduled_at < ?', Time.zone.now.end_of_day).paginate(per_page: 30, page: params[:today_tasks_page]) | |
@upcoming_tasks = @incomplete_tasks.where('scheduled_at > ?', Time.zone.now.end_of_day).paginate(per_page: 30, page: params[:upcoming_tasks_page]) | |
@past_tasks = @complete_tasks.paginate(per_page: 30, page: params[:past_tasks_page]).reorder('scheduled_at desc') | |
@job_tags = current_account.tags.where(tag_type: 'Job') | |
respond_to do |format| | |
format.html | |
format.js do | |
@param_name = params.keys.keep_if { |name| name =~ /_page/ }.first |
module FormHelper | |
def bootstrap_errors_for(attr, form, &block ) | |
errors = form.errors[attr] | |
error_messages = errors.map{|error| content_tag(:span, error)} | |
content = block_given? ? capture(&block) : "".html_safe | |
noko_content = Nokogiri::HTML::DocumentFragment.parse(content) | |
noko_content.css('.form-group')[0]['class'] = "#{noko_content.css('.form-group')[0]['class']} has-error" if errors.present? | |
if error_messages.present? |
export default (text) => text; |
I hereby claim:
To claim this, I am signing this object:
Currently state is used for 2 purposes. The first purpose is to transition between states.
Example: Transition from select_url to audit_select_url
The second use of state is to signify if the operation is a system status. System statuses are used to perform an operation in our system.
Example:
defmodule Dargons.DiceTest do | |
use ExUnit.Case | |
alias Dargons.Dice | |
describe "rolling dice" do | |
test "rolling a single D20" do | |
[first_dice | _] = dice = Dice.roll(20) | |
assert length(dice) == 1 | |
assert first_dice <= 20 | |
end |
FROM elixir:latest | |
MAINTAINER Josh Coffee | |
RUN apt-get update && apt-get install --yes postgresql-client nodejs inotify-tools | |
ADD . /app | |
RUN mix local.hex --force | |
RUN mix archive.install --force hex phx_new 1.4.16 | |
WORKDIR /app | |
EXPOSE 4000 |