Skip to content

Instantly share code, notes, and snippets.

View kitchen's full-sized avatar
🚴‍♂️
traveling the world

Jeremy Kitchen kitchen

🚴‍♂️
traveling the world
View GitHub Profile
#perl
grep { !($_ % 2) } (1,2,3,4)
#ruby
[1,2,3,4].select{ |x| x.even? }
#python
[x for x in [1,2,3,4] if not x%2]
#or, more norvingly
filter(lambda x: not x%2, [1,2,3,4])
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
126.0 33.0 980.6 49.0 0.0 0.9 0.0 5.4 0 43 c16t3d0
126.0 34.0 1145.6 49.0 0.0 1.6 0.0 10.2 0 69 c16t4d0
119.0 33.0 1155.1 49.0 0.0 1.2 0.0 7.6 0 53 c16t5d0
122.0 33.0 1155.6 48.5 0.0 1.1 0.0 7.1 0 49 c16t6d0
106.0 33.0 1056.1 48.5 0.0 2.2 0.0 16.1 0 73 c16t7d0
106.0 33.0 1011.6 49.0 0.0 1.0 0.0 7.2 0 45 c16t12d0
103.0 33.0 968.1 49.0 0.0 0.8 0.0 6.2 0 41 c16t13d0
103.0 33.0 1191.1 49.0 0.0 1.7 0.0 12.3 0 66 c16t14d0
116.0 33.0 1182.6 49.0 0.0 1.0 0.0 6.9 0 51 c16t15d0
@kitchen
kitchen / gist:2998174
Created June 26, 2012 19:17
generating strings for php which need to be in quotes
$foo = <%= bar %>

if bar is being passed in as just baz (no quotes) php will complain.
if bar is being passed in as "baz" (with quotes) it will work fine.

if I do something like:

$foo = "<%= bar %>"

bar can be passed in directly without quotes and it will Just Work

@kitchen
kitchen / make-symlinks.sh
Created July 18, 2012 17:27
dotfiles make-symlinks
@kitchen
kitchen / gist:3161865
Created July 23, 2012 03:19
certificate info
% openssl s_client -crlf -connect foilhat.org:443 !8215
CONNECTED(00000003)
depth=1 /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/OU=Domain Control Validated/OU=Provided by New Dream Network, LLC/OU=DreamHost Basic SSL/CN=foilhat.org
i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
1 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
@kitchen
kitchen / gist:3162029
Created July 23, 2012 05:00
success!
kitchen@river ~
% /usr/local/bin/python
Python 2.7.3 (default, Jul 22 2012, 21:45:32)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.61)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>>
@kitchen
kitchen / .muttrc
Created August 11, 2012 07:06
mutt config
set imap_user="kitchen@scriptkitchen.com
set imap_pass="PASSWORDGOESHERE"
set smtp_url=smtps://kitchen@scriptkitchen.com@smtp.gmail.com/
set smtp_pass=$imap_pass
# real name info
set realname="Jeremy Kitchen"
set from="kitchen@kitchen.io"
alternates "kitchen@scriptkitchen.com"
set envelope_from=yes
@kitchen
kitchen / .muttrc
Created August 23, 2012 03:49
muttrc first iteration
# me
set realname = "Jeremy Kitchen"
set from = "jeremy.kitchen@example.com"
set envelope_from = yes
# work account info
set imap_user="jeremy.kitchen"
set imap_pass="REDACTED"
set folder = imaps://mail.example.com/
@kitchen
kitchen / personal.rc
Created August 23, 2012 04:25
sample mutt configuration
# me
set realname = "Jeremy Kitchen"
set from = "kitchen@example.org"
set envelope_from = yes
# personal account info
set imap_user = "kitchen@example.org"
set imap_pass = "REDACTED"
set folder = imaps://imap.gmail.com/
set smtp_url = smtps://kitchen@example.org@smtp.gmail.com/
@kitchen
kitchen / README.md
Created September 1, 2012 03:11 — forked from vanto/README.md
OEmbed Liquid Tag for Jekyll

OEmbed Liquid Tag for Jekyll

This is a simple liquid tag that helps to easily embed images, videos or slides from OEmbed enabled providers. It uses Magnus Holm's great oembed gem which connects to the OEmbed endpoint of the link's provider and retrieves the HTML code to embed the content properly (i.e. an in-place YouTube player, Image tag for Flickr, in-place slideshare viewer etc.). By default it supports the following OEmbed providers (but can fallback to Embed.ly or OoEmbed for other providers):

  • Youtube
  • Flickr
  • Viddler
  • Qik
  • Revision3
  • Hulu
  • Vimeo