Skip to content

Instantly share code, notes, and snippets.

View mejarc's full-sized avatar

M. Archer mejarc

  • Oakland, CA, USA
View GitHub Profile
@mejarc
mejarc / how_many_hours.py
Created January 5, 2013 01:04
How many hours from now? A calculator for scheduling Buffer or Talentopoly posts. Relies on old-fashioned `raw_input`, but can be easily updated to Python 3.
from datetime import datetime
now = datetime.now()
print "Today is: ", now.strftime('%a, %d, %h %Y')
how_many_days = raw_input("How many days from now should this post? ")
print how_many_days
how_many_hours = (int(how_many_days)) * 24
print "This is %d hours." % how_many_hours
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Jacob Rus</string>
<key>comment</key>
<string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string>
<key>name</key>
<string>Cowboy - Presentation</string>
@mejarc
mejarc / cowboy.py
Created February 22, 2013 16:23
Ben Alman's TextMate presentation theme converted for Pygments
# -*- coding: utf-8 -*-
"""
Cowboy Colorscheme
~~~~~~~~~~~~~~~~~~
Converted by Vim Colorscheme Converter
"""
from pygments.style import Style
from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String
-- Make sure a presentation is opened in Keynote. If not, notify the user and stop.
tell application "Keynote"
if (front slideshow exists) = false then
display alert "Unable to proceed." message "Please open a presentation in Keynote."
return
end if
set extractBody to button returned of (display alert "Would you like to extract slide content too?" buttons {"Yes", "No"}) = "Yes"
-- Target the front presentation.
@mejarc
mejarc / my-fantasy-bootstrap.less
Last active December 15, 2015 14:09
Recreating Bootstrap styles for my own CSS selectors.
// Core variables and mixins.
// Unless otherwise noted, all @imports are from standard Bootstrap.
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less"; // Note: this is where Bootstrap establishes those '.span[...]' styles
@import "/css/less/lesshat/lesshat.less"; // Create your own Frankengrid by importing mixins from totally different libraries!
// CSS Reset
@import "reset.less";
@mejarc
mejarc / .bash_profile
Created June 3, 2013 18:14
Reduce the tedium of commonly typed commands with a bunch of shortcuts
alias ls='ls -al -G'
alias crm='open -a "Google Chrome" --args --proxy-pac-url=http://[workplace proxy address].pac'
alias bcc='bower cache-clean'
alias mx='cd /Library/WebServer/Documents/mds; ls -al'
alias ix='cd /Library/WebServer/Documents/iids; ls -al'
alias g='grunt'
alias rl='source ~/.bash_profile'
@mejarc
mejarc / best-practices.md
Last active December 28, 2015 11:19
A list of best practices/style guides, and tools to enforce them
@mejarc
mejarc / 0.2.1-boggle_class_from_methods.rb
Last active December 31, 2015 16:09 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
def initialize(grid)
@grid = grid
end
def create_word(*coords)
coords.map { |coord| @grid[coord.first][coord.last] }.join("")
end
def get_row(row)
@mejarc
mejarc / 0_reuse_code.js
Created January 12, 2014 16:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# foo_test.rb
class Meme
def i_can_has_cheezburger?
"OHAI!"
end
def will_it_blend?
"YES!"
end