Skip to content

Instantly share code, notes, and snippets.

View peteryates's full-sized avatar
🪶

Peter Yates peteryates

🪶
View GitHub Profile
@peteryates
peteryates / gist:1986294
Created March 6, 2012 13:33
inxi output
peter@tecra:/home/peter$ inxi -v4 -c6 OR inxi -s -bDc -A5 -xx
System: Host: tecra Kernel: 3.2.8-1-ARCH x86_64 (64 bit, gcc: 4.6.2) Desktop: Gnome (Gtk 3.2.3) Distro: Arch Linux
Machine: System: TOSHIBA product: TECRA M11-17 version: PTME1E-01M031EN
Mobo: TOSHIBA model: Portable PC version: Version A0 Bios: TOSHIBA version: Version 3.20 date: 06/27/2011
CPU: Dual core Intel Core i7 CPU M 640 (-HT-MCP-) cache: 4096 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 11177.1
Clock Speeds: 1: 2792.896 MHz 2: 2792.896 MHz 3: 2792.896 MHz 4: 2792.896 MHz
Graphics: Card: Intel Core Processor Integrated Graphics Controller bus-ID: 00:02.0
X.Org: 1.11.4 driver: intel Resolution: [email protected], [email protected]
GLX Renderer: Mesa DRI Intel Ironlake Mobile GLX Version: 2.1 Mesa 7.11.2 Direct Rendering: Yes
Network: Card-1: Intel Centrino Advanced-N 6200 driver: iwlwifi ver: in-tree: bus-ID: 02:00.0
@peteryates
peteryates / colour_blame_age.rb
Last active December 11, 2015 15:28
Colourise SVN blame
#!/usr/bin/env ruby-local-exec
require 'colorize'
def get_revision_number(line)
line.split(" ").first.to_i
end
def revision_position(revisions, number)
revisions[number] || revisions.last
@peteryates
peteryates / Destination Types
Created March 6, 2013 10:43
RECURSIVE QUERIES IN POSTGRESQL 8.4 BETA Originally posted http://pastie.org/539924
id | name
----+--------------
1 | COUNTRY
2 | ISLAND GROUP
3 | TOWN
4 | ISLAND
(4 rows)
@peteryates
peteryates / sample call
Created April 17, 2013 09:32
Simple thesaurus wrapper for the metanym gem
~»thesaurus boot
Boot:
Synonym: brogan, footwear, galoshes, mukluk, oxford, snow shoes, waders, waters
Antonym: aid, defend, protect, resist, retreat, shelter, shield, submit, support, surrender, sustain
@peteryates
peteryates / gtlds.txt
Created October 24, 2013 07:53
All of the gTLDs listed on http://gtld.123-reg.co.uk/
.academy
.accountant
.accountants
.actor
.ads
.adult
.agency
.airforce
.alsace
.amsterdam
%define name mecab-ipadic
%define ver 2.7.0
%define date 20070801
%define release el6.4_1
Summary: IPA dictionary for MeCab
Summary(ja): MeCab用のIPA辞書
Name: %{name}
Version: %{ver}.%{date}
Release: %{release}
@peteryates
peteryates / mecab.spec
Created February 12, 2014 09:29 — forked from hylom/mecab.spec
%define name mecab
%define version 0.996
%define release el6.4
Summary: Yet Another Part-of-Speech and Morphological
Name: %{name}
Version: %{version}
Release: %{release}
Source0: https://mecab.googlecode.com/files/mecab-%{version}.tar.gz
License: GPL/LGPL/BSD
@peteryates
peteryates / delegate_matcher.rb
Last active August 29, 2015 13:57 — forked from pcreux/delegate_matcher.rb
Updated to new RSpec syntax
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { expect(subject).to delegate(:title).to(:name) } # post.title => post.name
# it { expect(subject).to delegate(:month).to(:created_at) } # post.month => post.created_at
# it { expect(subject).to delegate(:author_name).to(:author, :name) } # post.author_name => post.author.name
# end

Keybase proof

I hereby claim:

  • I am peteryates on github.
  • I am peteryates (https://keybase.io/peteryates) on keybase.
  • I have a public key whose fingerprint is A846 F177 4703 66B2 FDD0 5B03 F5A9 E8AD 2A5C 54A1

To claim this, I am signing this object:

# select * from public_holidays limit 20;
id | name | date | notes | bunting | country_id | country_region_id | created_at | updated_at
----+---------------------------------------+------------+----------------+---------+------------+-------------------+----------------------------+----------------------------
30 | New Year’s Day | 2012-01-02 | Substitute day | t | 236 | 1 | 2014-08-20 09:08:59.079501 | 2014-08-20 09:08:59.079501
31 | Easter Monday | 2012-04-09 | | t | 236 | 1 | 2014-08-20 09:08:59.081972 | 2014-08-20 09:08:59.081972
32 | Spring bank holiday | 2012-06-04 | Substitute day | t | 236 | 1 | 2014-08-20 09:08:59.084068 | 2014-08-20 09:08:59.084068
33 | Summer bank holiday | 2012-08-27 | | t | 236 |