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
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) | |
Dim wsSheet As Worksheet | |
Application.ScreenUpdating = False | |
Select Case Range("H5") | |
Case "Hain" | |
For Each wsSheet In Worksheets | |
wsSheet.Visible = xlSheetHide | |
If wsSheet.Name Like "*Hain*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then |
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
def start_request | |
method = http.post :body => { data: { serial_no: serial } } | |
method.errback do | |
yield | |
$stderr.puts 'Can\'t connect to cloud' | |
end | |
method.callback do | |
yield | |
p method.response_header.status |
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
class Person | |
attr_reader :factory | |
attr_reader :name | |
def initialize(factory, name) | |
@factory = factory | |
@name = name | |
end | |
def coworkers |
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
<tr> | |
<td><%= hours[:paylocity_id] %></td> | |
<td>E</td> | |
<td>REG</td> | |
<td><%= hours[:regular_hours] %></td> | |
</tr> | |
<tr> | |
<td><%= hours[:paylocity_id] %></td> | |
<td>E</td> | |
<td>OT</td> |
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
module Export | |
module V1 | |
class GroupSerializer < ActiveModel::Serializers | |
attributes :items | |
def items_serializer | |
ItemsSerializer | |
end | |
def items |
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
= form_for([@forum, @topic]) do |f| | |
- if @topic.errors.any? | |
%div{id: 'error_explanation'} | |
%h2 | |
= pluralize(@topic.errors.count, "error") | |
prohibited this topic from being saved: | |
- for message in @topic.errors.full_messages | |
%li | |
= message |
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
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'bundler' | |
gem 'pry' | |
gem 'pry-doc' | |
gem 'pry-byebug' |
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
namespace :scrape do | |
desc "Take a screenshot of a url using Phantomjs" | |
task :screenshots => :environment do | |
require 'capybara' | |
require 'poltergeist/capybara' | |
include Capybara::DSL | |
Capybara.default_driver = :poltergeist | |
articles = Article.order('zscore DESC').limit(3) | |
articles.each_with_index do |article, i| |
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
common_packages = %w(python-setuptools python-dev) | |
case node['platform'] | |
when "centos", "redhat", "amazon" | |
platform_packages = common_packages + ['gcc'] | |
when "debian", "ubuntu" | |
platform_packages = common_packages + ['build-essential'] | |
end | |
platform_packages.each do |pkg| |
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 "benchmark" | |
Benchmark.bmbm(7) do |x| | |
iterations = 10_000 | |
a = 4000.times.map { |i| rand(i * 100).to_i } | |
a.sort! | |
NewerOlder