Forked from Chris Coyier's Pen Basic Example of SVG Line Drawing, Backward and Forward.
A Pen by Captain Anonymous on CodePen.
| require 'net/http' | |
| require 'thor/group' | |
| require './lib/daemon' | |
| class Test < Thor | |
| include Thor::Actions | |
| include Thor::Daemon | |
| desc "start", "running test servers" | |
| def start |
Forked from Chris Coyier's Pen Basic Example of SVG Line Drawing, Backward and Forward.
A Pen by Captain Anonymous on CodePen.
| module SoftDeletable | |
| extend ActiveSupport::Concern | |
| class ModelHasAssignedValues < StandardError; end | |
| included do | |
| scope :deleted, ->{ where.not(deleted: true) } | |
| scope :without_deleted, ->{ where(deleted: false) } | |
| scope :with_deleted, ->{ unscope(where: :deleted) } | |
| default_scope { without_deleted } |
| # Path to your oh-my-zsh installation. | |
| export ZSH=$HOME/.oh-my-zsh | |
| # Set name of the theme to load. | |
| # Look in ~/.oh-my-zsh/themes/ | |
| # Optionally, if you set this to "random", it'll load a random theme each | |
| # time that oh-my-zsh is loaded. | |
| ZSH_THEME="pygmalion" | |
| # Uncomment the following line to use case-sensitive completion. |
| # CSV.parse(csv_header, col_sep: ColSepSniffer.find(csv_header)) | |
| # returns a CSV::Table object | |
| p CSV.parse(csv_file, | |
| headers: true, | |
| col_sep: ColSepSniffer.find(csv_headers)).map(&:to_hash) | |
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| require "csv" |
| require 'rails/commands/server' | |
| module Rails | |
| class Server | |
| def default_options | |
| super.merge(Host: '0.0.0.0', Port: 3000) | |
| end | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| puts "Count with {}" | |
| puts [[1,1],[2],[3],[4,3]].count { |elements| !elements.all? { |element| element == elements.first } or elements.size == 1 } | |
| puts "----------------------" | |
| # Response: | |
| # Count with {} | |
| # 3 | |
| # ---------------------- |
| port module Spelling exposing (..) | |
| import Html exposing (..) | |
| import Html.Events exposing (..) | |
| import String | |
| main = | |
| program | |
| { init = init |
| port module Facebook exposing (..) | |
| import Html exposing (..) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (..) | |
| import String | |
| import Debug | |
| main = |