Print Avery labels using CSS and HTML

It really come in handy… thanks for sharing.

Boulder Information Services

A client for whom I provide web services asked me if I could help her print barcode labels from their data.

Now, I’ve created Avery labels using Office, Illustrator, even Photoshop — but never using web technologies. You just don’t have a lot of control printing from your browser using CSS.

Or do you…? After all, we’ve always been able to specify real-world measurements such as “in” and “cm” using CSS.

I bought Avery 5160 labels because they seemed big enough to allow me to be a little sloppy while still providing many stickers per page.

A quick test proved that I could specify the page margins, label sizes, and gutter widths in inches. And both Firefox and IE allowed me to set the print margins to 0, leaving control of the layout to my CSS. Here’s what the print preview looks like from Firefox:

It’s not perfect, but it’s…

Lihat pos aslinya 400 kata lagi

The Problem with empty()

http://stackoverflow.com/questions/1075534/cant-use-method-return-value-in-write-context/4328049#4328049

empty() needs to access value by reference (in order to check whether that reference points to something that exists), and PHP before 5.5 didn’t support references to temporary values returned from functions.

However, the real problem you have is that you use empty() at all, mistakenly believing that “empty” value is any different from “false”.

Empty is just an alias for !isset($thing) || !$thing. When the thing you’re checking always exists, the empty() function is nothing but a negation operator.

PHP doesn’t have concept of emptyness. Values that evaluate to false are empty, values that evaluate to true are non-empty. It’s the same thing. This code:

$x = something();
if (empty($x)) …
and this:

$x = something();
if (!$x) …
has always the same result, in all cases, for all datatypes (because $x is defined empty() is redundant).

Return value from the method always exists (even if you don’t have return statement, return value exists and contains null). Therefore:

if (!empty($r->getError()))
is logically equivalent to:

if ($r->getError())

Memori Ojek Pangkalan dan Monopoli Gojek

An interesting point of view regarding Gojek.

www.go-jek.com http://www.go-jek.com

Kalau Jakarta mau jadi metropolitan yang sebenarnya, Gojek harus memonopoli semua pangkalan ojek. Harus profesional, teratur, terstruktur dan meminimalisir hubungan negosiasi antara tukang ojek (yang disebut driver (supir) oleh Gojek, padahal harusnya Rider (pengendara) karena motor tidak disetir tapi dikendarai)). Akan ada kepastian harga, kepastian keselamatan (asuransi) dan tidak ada ruang main-main atau dipermainkan. Apakah kita mau? Jangan bilang mau begitu saja, itu artinya gampang digodain setan. Coba saya bantu anda dengan memori saya tentang ‘institusi lokal’ yang hendak dibantai modernisme ini.

Anggap saja namanya pak Adi (bukan nama sebenarnya). Dia tukang ojek langganan saya dari Depok-Cilandak waktu saya masih tinggal di Margonda dan bekerja di sebuah sekolah national plus tahun 2009-2011. Pak Adi ini sarjana muda dan kuliah di kampus yang sama dan jurusan yang sama seperti bapak saya. Kalau saya ngobrol sama dia, saya jadi ingat pada bapak saya.

Ada lagi Mamat (juga bukan nama sebenarnya). Dia tukang…

Lihat pos aslinya 1.131 kata lagi

Ruby Gem Fix SSL Certificate Verification Error

How to fix error and get back to https with ssl:
The reason is old rubygems. So we need to remove ssl source to be able to update gem –system which includes rubygems and so on. after this we can feel free to get back to ssl source.

gem sources -r https://rubygems.org/ - to temporarily remove secure connection
gem sources -a http://rubygems.org/ - add insecure connection
gem update --system - now we're able to update rubygems without SSL

after updating rubygems do vice versa

gem sources -r http://rubygems.org/ - to remove insecure connection
gem sources -a https://rubygems.org/ - add secure connection

Now you’re able to update gems using secure connection.

gem update

http://stackoverflow.com/questions/10246023/bundle-install-fails-with-ssl-certificate-verification-error/10430331#10430331

Workaround RubyGems’ SSL errors on Ruby for Windows (RubyInstaller)

Intip Rok Wanita Dengan Bersembunyi di Selokan, Seorang Pria Ditangkap

man-hides-in-gutter-women-skirts-japan-01

Berita ini memang sudah lama, tahun 2013, tapi menarik perhatian saya yang baru saja membacanya. Selain inovatif dan maju, Jepang juga terkenal dengan pria-pria hidung belangnya. Seorang pria asal Kobe, Jepang ditangkap karena melakukan kejahatan yang unik dan bisa dibilang jenius.

Hirai Yasuomi (26), dilaporkan ke polisi setelah seseorang mendapatinya tiduran terlentang di sebuah selokan pinggir jalan untuk mengintipi rok-rok wanita yang lewat diatasnya. Tentu saja, tidak seperti di Jakarta, selokan di Jepang bersih dan ada tutupnya yang garis-garis seperti di komik Doraemon.

Meski banyak orang mengutuk perbuatan tercelanya dan berharap pria tersebut dihukum berat, netizens juga memberi pujian atas antusiasme dan determinasi pria hidung belang tersebut.