January 2011
16 posts
2 tags
Removing a jQuery object from another jQuery...
Working on Isotope, I have a scenario where I need to remove a jQuery object from another jQuery object. Item elements are cached within the plugin’s instance. If the user needs to remove those elements from the DOM, they need to also remove them from the cache.
The solution is to use the .not method.
// removes $b from $a
$a = $a.not( $b )
You need to assign the result of the...
2 tags
SSH and SCP: Howto, tips & tricks « Linux Tutorial... →
Regarding yesterday’s SFTP over Terminal, SCP is what I was looking for. Thanks Ben Schwarz for the tip.
The scp command allows you to copy files over ssh connections. This is pretty useful if you want to transport files between computers…
To upload
$ scp examplefile user@mydomain.com:/path/to/
To download
$ scp user@mydomain.com:/path/to/examplefile .
1 tag
SFTP from Terminal
I haven’t figured out a sweet use-case for this, but hey, it’s there.
sftp user@mydomain.com
# then enter password...
# upload
put remote-path [local-path]
# download
get remote-path [local-path]
# get help
help
Special Characters [Robin’s HTML 4.0 Conformance... →
Details on soft hyphen ­, zero-width spaces ​ and ligatures.
1 tag
Rakefile at from jquery/jquery - GitHub →
Last version of the jQuery Rakefile. It was subsequently removed. I’m saving this for posterity. Decent reference for minification and file concatenation with Rake.
3 tags
Chrome GPU accelerated compositing and 3D CSS...
Contrary to my observations a week ago, Chrome beta channel (I’m currently running 9.0.597.67 beta) now supports GPU accelerated compositing a.k.a. hardware acceleration and 3D CSS transforms.
Go to about:flags URL and enable GPU Accelerated Compositing, then restart Chrome.
Accelerated compositing works as expected. Transforms that use translate3d( x, y, 0 ) transition much more...
2 tags
Gollum wiki downers
I’ve been fiddling with a Gollum wiki and found a couple disappointments running locally.
Changes must be committed in the git repo before they are seen in the wiki.
Gollum only runs from master branch. Issue 94. Coupled with the previous issue, this prevents any way to preview changes. If you wish to view changes, you must commit to the master branch.
If the Home page is missing, no...
2 tags
Exponential notation
23:23 into 11 More Things I Learned from the jQuery Source, Paul Irish briefly mentions exponential notation for numbers.
4e3 // => 4 * 10 * 10 * 10 => 4000
He uses in .animate() call for 4000 milliseconds.
2 tags
Polka dot background with gradients
Playing around with gradient backgrounds after Lea Verou and Benjamin De Cock’s demos. Gradients don’t render with perfect anti-aliasing if two color-stops share are especially close to one another. Circles are rendered with pixelated edges. It’s probably better just to use an image here, or if it needs to be dynamic, perhaps generate the image via <canvas>.
Fiddle:...
2 tags
Google JavaScript Style Guide →
Always good to gloss over code style guides. This one advocates single quotes over double.
Something’s fishy about this one. It gives explicit instructions on how to open up collapsable dialogs (This doc is for JS developers, right?). Its source is XML. It has no global nav - no link back to its parent, google-styleguide. Maybe it’s all a sign that Google’s devs are still...
1 tag
Google Chrome Labs
Whitson Gordon at Lifehacker:
If you’re running the dev build but still itching to try even more experimental (and possibly buggier) features, just type in about:flags in Chrome’s address bar to see a list of experimental features available in the build.
You know it’s awesome because there’s a big warning sign.
I run the dev branch of Chrome, so it’s nice...
3 tags
left / top / right / bottom positioning
So many gems within Jordan Dobson’s animated border demo, but I especially like his use of positioning with all four directions.
left: 0;
top: 0;
right: 0;
bottom: 0;
With no size dimensions set, the child element stretches to the size of its parent. Typically, when I want a absolutely-positioned element to match its parent, I’ll use left: 0; top: 0; width: 100%; height: 100%;. The...
2 tags
oppositeOf object
Clever pattern by Ryan Stout to get the opposite value for strings.
var oppositeOf = {
'up' : 'down',
'down' : 'up',
'left' : 'right',
'right' : 'left',
'black' : 'white',
'white' : 'black'
};
oppositeOf['left'];
// => 'right'
Phil Dokas:
…That’s the memento design pattern. That’s how Undo in OS X is implemented :)
3 tags
::-webkit-scrollbar on body in Chrome
Chrome renders ::-webkit-scrollbar styles on the body in Chrome.
See ::-webkit-scrollbar demo
::-webkit-scrollbar fiddle
4 tags
#color keyword values
WebKit parses #colorkeyword values as valid colors. background: #yellow renders as yellow.
#color fiddle
Being thorough, I also tested other color values with an extra # in front. No dice, only keywords get parsed.
2 tags
outline and outline-offset
Typically, I’ve only seen outline used for :active styles, i.e. a:active { outline: none; }. Smartypants Piotr Petrus clued me in to using outline for offset borders with outline-offset.
outline fiddle
Note that outline does not inherit border-radius. Firefox does have -moz-outline-radius just for this. No outline-radius in other browsers currently.