Skip to content

Instantly share code, notes, and snippets.

View rays's full-sized avatar

Ray Slakinski rays

View GitHub Profile
@rays
rays / cronjob.sh
Created October 21, 2013 18:59 — forked from memonic/cronjob.sh
#!/bin/bash
(/usr/local/bin/db2log | \
mk-query-digest --fingerprints \
--filter '$event->{user} !~ m/^(bi|memonic)$/') 2>&1 | \
mail -s "MySQL slow logs" root
# Rotate slow logs. Will move them into the backup table slow_log_backup. If
# that table exists it's overwritten with the primary slow log.
# So with this strategy we can still access yesterday's slow log by querying
# slow_log_backup.
#
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@rays
rays / github_issues_to_csv_v3.rb
Created September 28, 2012 10:27 — forked from kevinpschaaf/github_issues_to_csv_v3.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Description:
# Exports Github issues from one or more repos into CSV file formatted for import into JIRA
# Note: By default, all Github comments will be assigned to the JIRA admin, appended with
# a note indicating the Github user who added the comment (since you may not have JIRA users
# created for all your Github users, especially if it is a public/open-source project:
#
@rays
rays / github_issues_to_csv_v3.rb
Created September 28, 2012 10:27 — forked from kevinpschaaf/github_issues_to_csv_v3.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Description:
# Exports Github issues from one or more repos into CSV file formatted for import into JIRA
# Note: By default, all Github comments will be assigned to the JIRA admin, appended with
# a note indicating the Github user who added the comment (since you may not have JIRA users
# created for all your Github users, especially if it is a public/open-source project:
#
@rays
rays / gist:1886812
Created February 22, 2012 19:34 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import urllib
import urllib2
import simplejson as json
from datetime import datetime, timedelta, tzinfo
from getpass import getpass
def parse_datetime(str):
class FixedOffset(tzinfo):
@rays
rays / gist:899416
Created April 2, 2011 11:31 — forked from tobsn/gist:899413
$list_pattern = 'SELECT
%5$s AS zip,
%6$s AS name,
SQRT( (
( %2$d - %8$s ) *
( %2$d - %8$s )
) + (
( %1$d - %7$s ) *
( %1$d - %7$s )
) ) AS distance
@rays
rays / Python SMTP server one-liner
Created October 27, 2009 17:09 — forked from eculver/Python SMTP server one-liner
Create a debugging smtpd server for testing mail
python -m smtpd -n -c DebuggingServer localhost:1025
@rays
rays / capistrano-memcached.rb
Created July 24, 2009 21:40 — forked from mbbx6spp/capistrano-memcached.rb
memcached Capistrano tasks
# 2007 Copyright Susan Potter <me at susanpotter dot net>
# You can read her software development rants at: http://geek.susanpotter.net
# Released under CreativeCommons-attribution-noncommercial-sharealike license:
# http://creativecommons.org/licenses/by-nc-sa/1.0/
namespace :memcached do
desc "Restart the Memcache daemon"
task :restart, :roles => :app do
deploy.memcached.stop
deploy.memcached.start
end
@rays
rays / Web product guidelines
Created July 17, 2009 16:04 — forked from leah/Web product guidelines
Web product guidelines
- make complex things simple
- personal vanity
- internet is global, but dont forget the local perspective
- permalinks
- one important item per page
- don't break the browser
- don't wanker in technology
- break convention for your users
- no useless widgets
- nobody changes the defaults