Skip to content

Instantly share code, notes, and snippets.

View bobthecow's full-sized avatar

Justin Hileman bobthecow

View GitHub Profile
@bobthecow
bobthecow / top-github.md
Last active December 29, 2023 23:55 — forked from anvaka/top-github.md
Top GitHub users by total number of stars

I was playing with GitHub Archive recently. Out of curiosity I ran this query:

SELECT COUNT(repository_owner) as totalStars, repository_owner
FROM [githubarchive:github.timeline] 
WHERE type = 'WatchEvent'
AND repository_organization IS NULL
GROUP BY repository_owner
ORDER BY totalStars DESC
@bobthecow
bobthecow / reflection.php
Created October 29, 2014 17:37
PHP is the best at reflection.
<?php //\\ dɥd¿>
;namespace ǝɔɐdsǝɯɐu;
class ssɐlɔ
{ //\\ }
function uoıʇɔunɟ
( )
{ //\\ }
;echo oɥɔǝ;

Keybase proof

I hereby claim:

  • I am bobthecow on github.
  • I am bobthecow (https://keybase.io/bobthecow) on keybase.
  • I have a public key whose fingerprint is 9177 E181 69EE D627 6F32 7A45 02BA 291C FB37 7198

To claim this, I am signing this object:

This is for RESTful PATCH awesomeness:

var myModel = new Backbone.Model({
  title:   "Current title",
  content: "Content",
  bonus:   42
});
@bobthecow
bobthecow / gist:4774286
Last active December 12, 2015 12:48 — forked from smkelly/gist:4774258
# if you want an icon, add it to your attributes:
# menu_link('Foo', '/foo/', icon: 'bar')
def menu_link(text, target, attributes={})
# Prepend the icon, if supplied
if icon = attributes.delete(:icon)
text = "<i class='#{icon}'></i>#{text}"
end
# Build a link
@bobthecow
bobthecow / rules.rb
Last active April 27, 2023 16:43
Maid rules
# https://github.com/benjaminoakes/maid
Maid.rules do
## Trash a bunch of downloaded stuffs ##
rule 'Trash duplicate downloads' do
# Keep the dupe with the shortest filename
trash verbose_dupes_in('~/Downloads/*')
end
@bobthecow
bobthecow / tenkey.markdown
Created November 3, 2012 18:51
Mechanical USB numeric keypad landscape
<?php
// load n classes from the filesystem
if (count($argv) !== 3) {
throw new InvalidArgumentException('usage: php apc.php numtemplates size');
}
$numtemplates = $argv[1];
$templatesize = $argv[2];
@bobthecow
bobthecow / gist:3866586
Created October 10, 2012 16:06
A proposal for the Nanoc 4.0 Rules DSL

A proposal for the Nanoc 4.0 Rules DSL

I'd love to see something very much like this:

# Rules

compile '/article/*' do
  filter :erb