This blog is outdated. Check out my website at http://cem.re or my work blog at http://cem.re/tumblr.

can't use it

a blog by Cemre Güngör

Cargocollective theme for Posterous

I spent a couple of hours porting the Cargocollective look to posterous. It displays a list of your pages at the left. It might not work well with other use cases, in which case you’ll have to update it a bit :) The code is hacky, but might provide a good start for you.

The code is based on the theme Contra although now it looks nothing like it :)

To use it, select the contra theme, then go to Advanced and and click on Enable Advanced Theming. It’ll make a copy of Contra, and enable a field to put in code. Just paste the code linked below in there. You’ll also need to tweak the colors.

Näyttökuva 2011-02-07 kohteessa 11.51.11 AM

Download the code for Posterous cargo/cargocollective theme

The Compass CSS3 uber button

This button style works for a div, an inline-block, and a button as well. uberbutton is for a dark button with white text, uberbutton2 is for a light button with dark text. Just give them gradient colors to obtain your sweet button!

Here’s how it looks like:

Etkinliğbini hemen yayınla!

Here’s the code!

As an added bonus, if you use CSS3PIE, you get the gradient and rounded corners on IE as well with almost no work!

How to turn off the screen while playing Youtube videos on the iPhone

Useful while listening to music from youtube:

  1. While video is playing, turn iPhone’s screen off by pressing the power button. The music should stop
  2. Click the home button once to turn the screen on
  3. Click the home button twice to trigger play/pause controls
  4. Press play. The music of the video will start playing
  5. Turn iPhone’s screen back off by pressing the power button

How to inspect :hover CSS attributes with Firebug

I just realized there is an option for that. Thanks Firebug developers!

Just click the arrow button next to the Style tab.

Screen shot 2010-10-05 at 4.50.01 PM

How to disable all emails from Facebook (bookmarklet)

Facebook’s friendly email notification page forces you to uncheck 50 different checkboxes if you don’t want any emails.

Screenshot 2010-09-29 at 15.11.38

No more. Drag this bookmarklet to your bookmarks toolbar, and click on it when you are in the “Notifications” page in “My Account”. It will clear all the checkboxes for you. Then click “Save Changes” at the bottom of the page.

How to block/ignore all event invites from a person on Facebook

Block event invites easily (for example from your friends from other cities).

Privacy Settings > Block Lists > Block event invites

Prevent gradient banding with limited palette

Adding a small amount of noise on gradients as a texture has been fashionable for quite a while, but only recently I discovered that they have a nice by-product: they prevent banding while being exported with a limited palette:

banding

This is especially useful as it lets you disable dithering on the overall image (which sometimes causes small text to get illegible) and dither only the gradients.

HTML Emails: Yahoo overwrites/overrides link color

If you do e-mail marketing work, you probably noticed Yahoo! Mail overwriting link colors with their blue. They do this to display users supplemental information and ads.

By chance, I found out that having any tags inside the <a>, such as a <span>, avoids this. So wrap your text links <a><span></span></a> in to retain the colors you set for the links.

Different stroke/fill opacities in Adobe Fireworks

Fireworks doesn’t officially support setting different opacities for fills and strokes, but here are two workarounds:
- Stroke less opacity than fill: Use effects / Photoshop live effects / stroke, set opacity accordingly
- Fill less opacity than stroke: Re-create the solid fill using gradient fill with 2 same colors, then use gradient fill’s opacity sliders to decrease fill opacity. This will not affect the stroke.

Automatically convert all CSS rgb colors to hex colors

If you copy pasted CSS from firebug’s inspector, the colors turn out as rgb(a,b,c). To fix your file and revert all colors to #aabbcc hex format, use this PHP script:


$string = <<
(put your CSS here)
EOD;
$pattern = '/rgb\((\d+),\s*(\d+),\s*(\d+)\)/e';
$replacement = '"#" . dechex(\\1) . dechex(\\2) . dechex(\\3)';
echo preg_replace($pattern, $replacement, $string);

There usually aren’t any ‘$’ characters in CSS but if you have them, escape them while putting the CSS in heredoc :)