Skip to content

Instantly share code, notes, and snippets.

View asimpson's full-sized avatar

Adam Simpson asimpson

View GitHub Profile
@asimpson
asimpson / font-size.scss
Created October 5, 2012 20:24
Old Scss Font-size mixin
@mixin font-size( $decimal-size ) {
font-size: $decimal-size * $base-font-multiplier * 16px;
font-size: $decimal-size * 1rem;
}
@asimpson
asimpson / sitemap-snippet
Created October 31, 2012 16:57
EE Snippet for sitemap.xml, repeat for each block of urls.
{exp:channel:entries channel="channel-name"}
<url>
<loc>relative_url/{url_title}</loc>
<lastmod>{entry_date format="%Y %m %d"}</lastmod>
<changefreq>time-value</changefreq>
</url>
{/exp:channel:entries}
@asimpson
asimpson / bash_function
Created October 31, 2012 18:51
This little script sets up a custom domain in MAMP and your hosts file.
function vhost {
sudo ~/.dotfiles/osx/mamp_vh.sh $1
}
@asimpson
asimpson / chirp.coffee
Created December 7, 2012 20:38
chirp code
Chirp
user: "a_simpson"
max: 5
count: 5
retweets: true
replies: false
templates:
base: '<ol>{{tweets}}</ol>'
tweet:'<li><time><a href="http://twitter.com/{{user.screen_name}}/statuses/{{id_str}}">{{time_ago}}</a></time><article class="tweet">{{html}}<footer class="tweet-actions"><ul><li><a target="_blank" href="https://twitter.com/intent/retweet?tweet_id={{id_str}}" title="retweet">Re-tweet</a></li><li><a target="_blank" href="https://twitter.com/intent/favorite?tweet_id={{id_str}}" title="favorite">Favorite</a></li><li><a target="_blank" href="https://twitter.com/intent/tweet?in_reply_to={{id_str}}" title="reply">Reply</a></li></ul></footer></article></li>'
target: "tweets"
@asimpson
asimpson / setInterval.coffee
Created December 17, 2012 16:45
setInterval, clearInterval
sliderAnimation: ->
window.setInterval ->
APP.SLIDER.runSlider $('.main-content .slider')
, 4000
anotherFunction: ->
window.clearInterval(APP.SLIDER.sliderAnimation)
@asimpson
asimpson / beliefs-draft.md
Created December 18, 2012 21:10
Content thoughts for the new SB site

Beliefs

  • break it into two sections, Work Principles, Team Principles

Work Principles

  • Build it Right
    • Embrace details, intentionality, and standards in every aspect of building for the web, it's simply the right way to build.
  • Solve Real Problems
    • Asking the right questions reveals the real problems and drives work that produces true solutions.
  • Content is Paramount
  • The web exists to communicate message and provide function — these shall be our primary interests.
@asimpson
asimpson / sublime_settings.json
Created January 10, 2013 02:46
sublime settings
{
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"draw_centered": false,
"fade_fold_buttons": false,
"font_face": "Menlo",
"font_size": 14.0,
@asimpson
asimpson / misc.coffee
Created January 16, 2013 14:53
misc snippets that didn't get used in a project, but I want to save the code for future reference.
$(".slider").each (index, Element) ->
animateName = window.setInterval ->
APP.SLIDER.animateSlider(Element)
, 4000
$(this).attr("data-animate-number", animateName)
animateSlider: (target) ->
numOfChildren = $(target).children(".slide").length
disToAnimate = $(".slider-wrapper").width()
slideCounter = parseInt($(target).attr('data-slider-count'), 10)
@mixin rem-fix( $property, $a:0, $b:$a, $c:$a, $d:$b ) {
@if ( $property == "font-size" ) {
// $a is the font size
// %b is the keyword
@if ( $a != $b ) {
font-size: $b;
}
@else {
font-size: $a * $base-font-multiplier * 16px;
}
@asimpson
asimpson / alias_lookup.sh
Created January 17, 2013 14:39
The function to look up aliases. Simply add a comment at the beginning and end of a block of aliases like #[thing-start] and #[thing-end]
function gfind {
awk "/#\[$1-start\]/,/#\[$1-end\]/ { print }" ~/.dotfiles/bash/aliases
}