| layout | title | date | comments | categories | external-url |
|---|---|---|---|---|---|
post |
Published on nettuts! |
2011-08-09 10:31 |
false |
Well this is exciting! I was just published in my first big blog! Check
| updateNav: function() { | |
| Element.show('hoverNav'); | |
| // if not first image in set, display prev image button | |
| if((activeImage != 0) && ($("lightbox2").getStyle('display') === 'block')){ // only register these event handlers if the lightbox is active | |
| Element.show('prevLink'); | |
| document.getElementById('prevLink').onclick = function() { | |
| myLightbox.changeImage(activeImage - 1); return false; | |
| } |
| array = [ :zero, :one, :two, :three, :four ] | |
| print array.length # 5 | |
| print :four == array[4] # true — zero-indexed, so array[4] is the 5th item. | |
| print array[5].nil? # true | |
| print array[6].nil? #true | |
| print [] # nil | |
| print array[5, 0] # nil | |
| print [] == array[5, 0] # true b/c both are nil |
| hate to bother you. im having trouble adding a challege_group via the console. i can see that when i do the following: | |
| u = User.find(4) # 4 is my user id | |
| u.challenges # returns a blank array | |
| I get the desired results. However, I'm just not 100% sure of the syntax to add a challenges_group. I've tried a bunch of different things, and still no luck. |
| ## please note: this assumes you have a folder called _StartingSiteTemplate in ~/Documents. | |
| ## i have uploaded a zip of my _StartingSiteTemplate here: http://cl.ly/1u2W1K2Q192Z3C0r2J0x | |
| ## that file above is based off of paul irish's html5 boilerplate - highly recommended! | |
| ## NOTE: this is using textmate and LESScss, but those are easily configurable. | |
| ## NOTE: if rsync isn't working for you, note the file paths I'm using. | |
| newSite(){ | |
| echo "Please name the directory: " | |
| read SITE_NAME | |
| echo "Creating $SITE_NAME... zomg!" |
| // goes with Boris Smus's keysocket extension <https://github.com/borismus/keysocket/> | |
| var PREV = 20; | |
| var PLAY = 16; | |
| var NEXT = 19; | |
| var fake_prev_el = document.createElement('div'); | |
| fake_prev_el.id = "fake_prev_el"; | |
| fake_prev_el.style.height = 0; | |
| fake_prev_el.style.width = 0; |
| { | |
| "name": "Key Socket Media Keys", | |
| "permissions": [ "tabs" ], | |
| "update_url": "http://clients2.google.com/service/update2/crx", | |
| "version": "0.2", | |
| "icons": { "16": "icon16.png", | |
| "48": "icon48.png", | |
| "128": "icon128.png" }, | |
| "description": "Control your favorite web-based music player with your keyboard's media keys", | |
| "permissions": ["tabs"], |
| layout | title | date | comments | categories | external-url |
|---|---|---|---|---|---|
post |
Published on nettuts! |
2011-08-09 10:31 |
false |
Well this is exciting! I was just published in my first big blog! Check
| --- | |
| layout: default | |
| title: "Blog" | |
| date: 2011-12-29 11:34 | |
| --- | |
| <h3 class="subhead small-margins">Posts</h3> | |
| <ul class="posts"> | |
| {% assign index = true %} |
| #!/bin/sh | |
| # A pre-commit hook for git to lint JavaScript files with jshint | |
| # @see https://github.com/jshint/jshint/ | |
| if git rev-parse --verify HEAD >/dev/null 2>&1 | |
| then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
| # WHAT IS THIS? | |
| # This is a pre-commit hook that runs your js code against jshint before committing. | |
| # If you ever want to make a commit without it running this, simply run: | |
| # git commit -n | |
| # INSTRUCTIONS: | |
| # 1. Install jshint-runner: npm install -g jshint-runner | |
| # 2. In your git project, rename .git/hooks/pre-commit.sample to .git/hooks/pre-commit | |
| # 3. Create a .jshintrc file in ~/. This is simply an object with the options you want. See mine here: https://gist.github.com/1597131 | |
| # 4. Paste the code below line 14 in that ~/.jshintrc file |