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
(?) :: Foldable t => t a -> t a -> t a | |
a ? b | |
| null a = b | |
| otherwise = a |
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
pcm.dmixed { | |
type asym | |
playback.pcm { | |
type dmix | |
ipc_key_add_uid true | |
ipc_key 5678293 | |
ipc_perm 0660 | |
ipc_gid audio | |
slave { |
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 combine_ranges(ranges) | |
if ranges.empty? | |
[] | |
else | |
first, *rest = ranges | |
rest.reduce([first]) do |result, current| | |
previous = result.pop | |
if previous.max + 1.day >= current.min | |
result << previous.min..current.min | |
else |
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
describe Person do | |
describe "#billable" do | |
it "returns people with a billable role" do | |
billable = create(:role, billable: true) | |
unbillable = create(:role, billable: false) | |
create(:person, name: "BillableOne", role: billable) | |
create(:person, name: "BillableTwo", role: billable) | |
create(:person, name: "Unbillable", role: unbillable) | |
result = Person.billable |
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
Section "InputClass" | |
Identifier "Apple Keyboard" | |
MatchProduct "Apple Inc. Apple Keyboard" | |
Option "XkbOptions" "altwin:swap_alt_win,ctrl:nocaps" | |
EndSection |
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
#!/bin/zsh | |
original=$(cat) | |
print "$original" > /tmp/mutt_message | |
ascii=$(print "$original" | recode utf-8..iso-8859-1 2>&1) | |
if echo "${ascii}" | egrep --silent "recode: Invalid input"; then | |
message=$(cat /tmp/mutt_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
class User | |
def initialize(name) | |
@name = name | |
end | |
def greet(greeting, info) | |
"#{greeting}, #{@name}! FYI, #{info}." | |
end | |
end |
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
> let a = [1] | |
> let b = [2] | |
> a + b | |
<interactive>:5:1: | |
No instance for (Num [t0]) arising from a use of ‘it’ | |
In a stmt of an interactive GHCi command: print it | |
> (on (+) head) a b | |
3 |
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
# Maintainer: Vincent Demeester <[email protected]> | |
# Contributer: Alex Ogier <[email protected]> | |
pkgname=ruby-build | |
pkgver=20141113 | |
pkgrel=1 | |
pkgdesc="Compile and install Ruby" | |
arch=('any') | |
url="http://github.com/sstephenson/ruby-build" | |
license=('MIT') | |
optdepends=('git: install ruby from git') |
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 String | |
def blank? | |
self == "" | |
end | |
end | |
class Symbol | |
def *(other) | |
lambda { |instance| instance.__send__(other).__send__(self) } | |
end |