Skip to content

Instantly share code, notes, and snippets.

View imathis's full-sized avatar
🍽️
Hungry for biscuits.

Brandon Mathis imathis

🍽️
Hungry for biscuits.
View GitHub Profile
@imathis
imathis / keybase.md
Created October 22, 2018 21:02
Keybase Proof

Keybase proof

I hereby claim:

  • I am imathis on github.
  • I am imathis (https://keybase.io/imathis) on keybase.
  • I have a public key ASDv6UKdWP1IsKjvk0pJega3CqiUZw9fA6nGz22Vgh9ORAo

To claim this, I am signing this object:

@imathis
imathis / set-game.js
Created April 8, 2016 15:34
Some simple javascript to power a game of Set.
var Deck = {
reset: function() {
this.size = 0
this.cards = []
while(this.size < 81) {
this.cards.push(Card.new(this.size))
this.size += 1
}
this.shuffle()
@imathis
imathis / clone.rb
Created August 17, 2015 03:10
Clone all repositories under a user or organization
#!/usr/bin/ruby
require 'open-uri'
require 'json'
user = 'imathis'
repos = open("https://api.github.com/users/#{user}/repos") { |f|
JSON.parse(f.readlines.join)
}
source 'https://rubygems.org'
gem 'jekyll'
group :jekyll_plugins do
gem 'octopress-littlefoot'
gem 'octopress-solarized'
gem 'octopress-codefence'
gem 'octopress-feeds'
gem 'octopress-multilingual'
end
# Pretty much pseduo code
# Let's just assume you're in a loop where you are generating each post
new_data = {
'title' => 'Some new title for this generated post post'
}
site.posts << Series::Post.new(site, site.source, index, post, new_data)
@imathis
imathis / Readme
Last active August 29, 2015 14:11
Workflow vs. Curl
Workflow concept:
1. Copy url from an instagram post, in this case "http://instagram.com/p/wwlwpFNCFe/".
2. Run a workflow which starts with a url from the clipboard and saves a photo to my camera library.
Workflow url: https://workflow.is/workflows/ba13f22dc7c34983a07d88978164bae1
I believe the problem is that when converting rich text to HTML, the parser removes stuff.
When I stop before the parser and send the webarchive to myself, the source has quite a bit more content than the rich text source.
@imathis
imathis / Readme.markdown
Last active August 29, 2015 14:05
Full with image in a max width content column

Allow any element to expand beyond the width of its parent container to fill the width of the browser window using vw and calc(). This is especially useful with images. Check out the Codepen demo.

This code is licensed under the MIT License.

### Keybase proof
I hereby claim:
* I am imathis on github.
* I am imathis (https://keybase.io/imathis) on keybase.
* I have a public key whose fingerprint is 86CA 84D1 66C9 FB97 44F8 2C6C 661F 438D 54B2 EA61
To claim this, I am signing this object:
@imathis
imathis / Guardfile
Last active December 19, 2015 11:19
Guard-Jekyll-Plus is a fancy Guard script for managing "smart" Jekyll builds. Changes in the source directory to non-template files will trigger a simple filesystem copy (or delete) to the destination directory. Changes to template files (configured by file extension) will trigger a Jekyll build.
require 'guards/guard-jekyll-plus.rb'
# Sample guard
guard :jekyll do
watch /^source/
watch '_config.yml'
end
@imathis
imathis / gist:5887081
Last active December 19, 2015 02:59
More readable coffeescript conditionals
# This is part of a simple javascript router I'm writing.
# When a link is clicked, the router checks to see if the url should trigger a route callback
# Here I demonstrate a way to improve long conditional statements with coffeescript and underscore.js
# Before: Concise but hard to read, hard to comment and hard to modify.
routeUrl: (url)->
return false if url is window.location.pathname || url.match /^http|^#/ || url.match /\.(png|gif|je?pg|pdf)$/i
url