Skip to content

Instantly share code, notes, and snippets.

View workmad3's full-sized avatar

David Workman workmad3

View GitHub Profile
var squaresTo = (limit) => {
var iterator = {
value: 1,
nextDelta: 3,
done: false,
next: () => {
return {
value: this.value + this.nextDelta,
nextDelta: this.nextDelta + 2,
done: (this.value + this.nextDelta) <= limit,
@workmad3
workmad3 / profile_selector.vba
Last active August 21, 2018 16:35
Customer Profile Selector
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
RSpec.describe SomeHelper do
let(:helper_class) do
Class.new do
attr_reader :request
include SomeHelper
def initialize(request)
@request = request
end
@workmad3
workmad3 / timer.rb
Last active June 7, 2017 09:26 — forked from universal/timer.rb
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
unit = ARGV[2]
if unit == "hours"
report = 12
dosing_interval = 24
elsif unit == "days"
report = 1
dosing_interval = 1
else
unit = "days"
report = 1
ary.sort do |left, right|
IMPORTANT = %w(X Y)
if IMPORTANT.include?(left) && IMPORTANT.include?(right)
IMPORTANT.index(left) <=> IMPORTANT.index(right)
elsif IMPORTANT.include?(left)
1
elsif IMPORTANT.include?(right)
-1
else
left <=> right
· Junior Web Developer Role
· Up to £25K
· Excellent Training and Mentoring in C# / .NET / MVC
· Company benefits
· Graduates welcome - no commercial experience necessary
This well known software house in Macclesfield is on the hunt for an aspiring Junior Web Developer to join their team of techies in developing the most cutting edge and modern software solutions. In joining this growing company, you will have the opportunity to work on numerous projects, including web applications, internal systems and websites.
This role would suit a 2016 graduate as well as those looking for a step up after their first commercial role after university. A degree is not necessary - if you have demonstrable skills in software development and are ready for a challenge then you will also be considered.
user system total real
Length: 10, encoding: US-ASCII 0.000000 0.000000 0.000000 ( 0.002861)
Length: 100, encoding: US-ASCII 0.010000 0.000000 0.010000 ( 0.003694)
Length: 1000, encoding: US-ASCII 0.000000 0.000000 0.000000 ( 0.003162)
Length: 10000, encoding: US-ASCII 0.000000 0.000000 0.000000 ( 0.003325)
Length: 100000, encoding: US-ASCII 0.010000 0.000000 0.010000 ( 0.003654)
Length: 1000000, encoding: US-ASCII 0.000000 0.000000 0.000000 ( 0.004246)
Length: 10000000, encoding: US-ASCII 0.010000 0.010000 0.020000 ( 0.010525)
require 'benchmark'
p ["Encodings: ", Encoding.default_external, Encoding.default_internal]
strings = {
10 => " " * 10,
100 => " " * 100,
1000 => " " * 1000,
10_000 => " " * 10_000,
100_000 => " " * 100_000,
1_000_000 => " " * 1_000_000
class True
class << self
def true?
self
end
def !@
False
end