Skip to content

Instantly share code, notes, and snippets.

🍽
Hungry for biscuits.

Brandon Mathis imathis

🍽
Hungry for biscuits.
Block or report user

Report or block imathis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 Apr 8, 2016
Some simple javascript to power a game of Set.
View set-game.js
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 Aug 17, 2015
Clone all repositories under a user or organization
View clone.rb
#!/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)
}
View Gemfile
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
View generator.rb
# 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 Aug 29, 2015
Workflow vs. Curl
View Readme
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 Aug 29, 2015
Full with image in a max width content column
View Readme.markdown

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.

View gist:9964117
### 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 Dec 19, 2015
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.
View Guardfile
require 'guards/guard-jekyll-plus.rb'
# Sample guard
guard :jekyll do
watch /^source/
watch '_config.yml'
end
@imathis
imathis / gist:5887081
Last active Dec 19, 2015
More readable coffeescript conditionals
View gist:5887081
# 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
You can’t perform that action at this time.