Skip to content

Instantly share code, notes, and snippets.

@will-clarke
will-clarke / codesign_gdb.md
Created June 6, 2023 19:39 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Will Clarke",
"label": "Software Engineer",
"email": "wmmclarke@gmail.com",
"url": "https://wclarke.net",
"summary": "I'm an experienced software engineer looking for remote Golang contracting work.\nI enjoy working with dynamic teams and finding good tradeoffs for software, teams and projects.",
"location": {
"address": "Dorset",
@will-clarke
will-clarke / 4clojure 53.clj
Created September 11, 2018 06:56
4clojure 53
;; Longest Increasing Sub-Seq - Hard
;; Given a vector of integers, find the longest consecutive sub-sequence of increasing numbers. If two sub-sequences have the same length, use the one that occurs first. An increasing sub-sequence must have a length of 2 or greater to qualify.
;; tags - seqs
;; restricted -
(ns offline-4clojure.p053
(:use clojure.test))
(defn consecutive-numbers
"can be reduced to a reduce call... :|"
([[h & t]] (consecutive-numbers t [h]))
require 'rspec'
require_relative 'checkout'
require_relative 'item'
describe Checkout do
subject { described_class.new({bogof: ['FR1']}) }
it '#item' do
expect(subject.item('FR1')[:price]).to eq(311)
class Checkout
attr_reader :basket, :pricing_rules
def initialize(pricing_rules)
@basket = []
@pricing_rules = pricing_rules
end
# [
# bogof: [ product_code ],
set ttymouse=xterm2
set mouse=a
let mapleader = " "
noremap ; :
imap jk <ESC>
noremap ; :
noremap : ;
require 'mechanize'
require 'open-uri'
a = Mechanize.new
(41..50).each do |i|
page = a.get("http://www.explosm.net/comics/#{i}/")
# image_url = page.image.first.url.to_s
leading_zeros = "%04d" % i
if page.image_with(alt: "Cyanide and Happiness, a daily webcomic")
image_url = page.image_with(alt: "Cyanide and Happiness, a daily webcomic").url.to_s
a.get( a.get(image_url) ).save_as "#{leading_zeros}-#{a.get(image_url).filename}"
require 'mechanize'
require 'open-uri'
a = Mechanize.new
(1..20).each do |i|
page = a.get("http://xkcd.com/#{i}/")
leading_zeros = "%04d" % i
if page.parser.css('#comic')
image_url = page.parser.css('#comic').children[1].first[1].to_s
a.get( a.get(image_url) ).save_as "#{leading_zeros}-#{a.get(image_url).filename}"
end
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context