Skip to content

Instantly share code, notes, and snippets.

View coyotebush's full-sized avatar

Corey Ford coyotebush

View GitHub Profile
SELECT actor, repository_owner, repository_name, repository_language, count(repository_name) AS pushes
FROM [publicdata:samples.github_timeline]
WHERE type='PushEvent'
AND repository_url IN
(SELECT repository_url FROM
(SELECT repository_url, MAX(repository_watchers)
FROM [publicdata:samples.github_timeline]
GROUP BY repository_url
HAVING MAX(repository_watchers) > 1000))
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2012-01-01 00:00:00')
SELECT user, top_repos.repository_url, repository_language, SUM(weight) as weight FROM
(SELECT repository_url, MAX(repository_watchers)
FROM [publicdata:samples.github_timeline]
GROUP BY repository_url
HAVING MAX(repository_watchers) > 1000) AS top_repos
JOIN EACH
(SELECT user, repository_url, repository_language, weight FROM
(SELECT actor AS user, repository_url, repository_language,
INTEGER(COUNT(repository_url)) AS weight
FROM [publicdata:samples.github_timeline]
SELECT repository_url, repository_language
FROM [publicdata:samples.github_timeline] AS t1
WHERE repository_language IN
(SELECT repository_language FROM
(SELECT repository_language, COUNT(repository_url) AS count
FROM [publicdata:samples.github_timeline] AS t2
WHERE t2.repository_url = t1.repository_url AND t2.repository_url IS NOT NULL AND repository_language IS NOT NULL
GROUP EACH BY repository_language
ORDER BY count DESC)
LIMIT 1)
class Player
def play_turn(warrior)
if warrior.feel.wall?
warrior.pivot!
elsif warrior.feel.captive?
warrior.rescue!
elsif warrior.feel.enemy?
warrior.attack!
@attacking = true
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("http://users\.csc\.calpoly\.edu/~grade_cstaley/.*/Transcript.*") {
body {
max-width: 30em;
margin: 2em auto;
font-size: 18px;
}
p, h5 {
font-size: 1em !important;
@coyotebush
coyotebush / expertmouse.conf
Created October 21, 2013 17:59
xorg.conf.d entries for my input devices
Section "InputClass"
Identifier "Kensington Expert Mouse"
MatchIsPointer "on"
MatchVendor "Kensington"
MatchProduct "Expert"
Option "ButtonMapping" "1 8 2 4 5 6 7 3 9 10 11 12"
Option "ConstantDeceleration" "1.6"
EndSection
#!/usr/bin/python
"""
Merge bank transaction fees into the main transaction in GnuCash.
This script searches a given account for "fee" transactions with a certain
description. It then tries to find the corresponding "real" transaction, adds
the fee amount to the real transaction, and deletes the fee transaction.
Assumptions: "fee" transactions come (not necessarily consecutively) after
@coyotebush
coyotebush / falling.c
Created April 13, 2014 15:49
My submissions to KTH Challenge 2014
#include <stdio.h>
int main() {
int D, n1, n2;
scanf("%d", &D);
for (n1 = 0; n1 < D; n1++)
for (n2 = 0; n2 < n1; n2++)
if ((n1 + n2) * (n1 - n2) == D) {
printf("%d %d\n", n2, n1);
return 0;
#!/usr/bin/env python
import struct
import sys
import binascii
# def str2bytes(string):
# return "".join("\\x" + "{0:02x}".format(ord(x)) for x in string)
def compare(bs, ks, tag=None):
if bs != ks:
@coyotebush
coyotebush / foss.tex
Created October 31, 2014 06:31
A five-minute introduction to the free software movement
\documentclass[14pt]{beamer}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{moresize}
\usetheme{Berkeley}
\beamertemplatenavigationsymbolsempty
\renewcommand{\arraystretch}{1.2}