Skip to content

Instantly share code, notes, and snippets.

View kneath's full-sized avatar
🌲
Growing soil

Kyle Aster kneath

🌲
Growing soil
View GitHub Profile
@kneath
kneath / not_a_joke.css
Created March 8, 2010 23:18
I wish this were a joke
.new-comments .starting-comment{
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
}
.new-comments .starting-comment .meta{
background-image:url(/images/modules/comments/metabar-large.gif);
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
@kneath
kneath / jquery.autoSuggest.css
Created January 26, 2010 23:53
Adds mozilla gradient support
/* AutoSuggest CSS - Version 1.1 */
ul.as-selections {
list-style-type: none;
border-top: 1px solid #888;
border-bottom: 1px solid #b6b6b6;
border-left: 1px solid #aaa;
border-right: 1px solid #aaa;
padding: 4px 0 4px 4px;
margin: 0;

Kyle's Guide

Just a placeholder for now, move along. Going to add what I consider vital design & development practices for use somewhere else in more complete form.

I am writing this down so I remember it. I have been writing HTML & CSS since somewhere around 1998, and much of what I have ingrained in my brain is outdated (body{ text-align:center; } anyone?). I need to rid this of my brain, and this is the only way I know how.

Leopard Machine (2Ghz Core Duo):
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
$ time ruby -rubygems -e ''
real 0m1.493s
user 0m0.214s
sys 0m0.076s
// HTML escapes `string`
var patterns = [[/&/g, "&amp;"], [/</g, "&lt;"], [/>/g, "&gt;"], [/"/g, "&quot;"]]
for(pattern in patterns)
string = string.replace(pattern[0], pattern[1]);
// for the line obsessed
for([[/&/g, "&amp;"], [/</g, "&lt;"], [/>/g, "&gt;"], [/"/g, "&quot;"]] in patterns); string = string.replace(pattern[0], pattern[1]);
@kneath
kneath / ._what.md
Created December 4, 2009 18:23
Badass git pull alias (up) to show commit log that just got pulled in addition to changes

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.

This is the first file in the series. Woo!
public/javascripts
|-- README.md
|-- admin
| |-- date.js
| `-- datePicker.js
|-- common
| |-- application.js
| |-- jquery.facebox.js
| `-- jquery.relatize_date.js
|-- dev
@kneath
kneath / _README.md
Created November 18, 2009 21:42 — forked from defunkt/bundle.rake
Intelligent asset bundling for Rails (GitHub's asset bundling)

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
/Users/kneath/Projects/github/main_site/public/javascripts/admin/date.js:191: WARNING - Parse error. type annotation incompatible with other annotations
* @type String
^
/Users/kneath/Projects/github/main_site/public/javascripts/admin/date.js:211: WARNING - Parse error. type annotation incompatible with other annotations
* @type String
^
/Users/kneath/Projects/github/main_site/public/javascripts/admin/datePicker.js:21: WARNING - Parse error. type annotation incompatible with other annotations
* @type jQuery