Skip to content

Instantly share code, notes, and snippets.

@srbaker
srbaker / gist:988ea77308e7978ccfa5
Last active August 29, 2015 14:04
Automatically double the volume when Won't Get Fooled Again is playing.
(*
In response to: https://twitter.com/martinfowler/status/489168910147928064
Run this after pressing play in iTunes.
*)
tell application "iTunes"
activate
set original_volume to sound volume
@srbaker
srbaker / gist:b82ff8f170f1c71f30e9
Last active August 29, 2015 14:01
Fizz Buzz in Haskell
-- Feels like there's a shorthand for the duplicated `mod` expressions.
fizzBuzz x
| (x `mod` 3) == 0 && (x `mod` 5) == 0 = "FizzBuzz"
| (x `mod` 3) == 0 = "Fizz"
| (x `mod` 5) == 0 = "Buzz"
| otherwise = show x
-- Extracting the mod expressions in any way I know how (so far) leads to more complication.
cc1plus: warnings being treated as errors
In file included from vm/gc/immix.hpp:4,
from vm/objectmemory.cpp:8:
vm/util/immix.hpp: In constructor ‘immix::Chunk::Chunk()’:
vm/util/immix.hpp:297: error: unused variable ‘ret’
vm/util/immix.hpp: In constructor ‘immix::SingleBlockAllocator::SingleBlockAllocator(immix::Block&)’:
vm/util/immix.hpp:588: error: unused variable ‘success’
rake aborted!
$2 = {cursor_ = {address_ = 0}, limit_ = {address_ = 0}, hole_start_line_ = 0,
block_ = 0x0}
$4 = {<immix::HoleFinder> = {cursor_ = {address_ = 0}, limit_ = {
address_ = 0}, hole_start_line_ = 0,
block_ = 0x0}, <immix::Allocator> = {
_vptr.Allocator = 0x13f37f0}, <No data fields>}
$5 = (immix::Block &) @0x15106e8: {address_ = {address_ = 140734009606144},
srbaker@gobo:~/Development/rubinius-1.1.0$ gdb vm/test/runner
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
test
Test gist.