26 Apr 2010

Best way to hide text: Go up

Quick Tips No Comments

With a larger monitor I’ve noticed many websites hiding text by sending it to the left or right. This works great on smaller monitors, but on higher resolution you all of a sudden see that text way off the side.

Simply send the text up instead. No matter how high of a screen resolution your user has, they will never be able to scroll above the top of your website.

.hideme {
   position:absolute;
   top:-1000;
}
16 Mar 2010

Simple PHP Random Image Script

PHP No Comments

There are times when working with smaller sites you need a simple method of displaying random images. This can be done in one line of text directly in your HTML and a collection of images.

Prepare the Images

The first step is to gather together the images you wish to have randomly rotated. Change all of their file names to a numerical order, starting with the number 1.

  • 1.jpg
  • 2.jpg
  • 3.jpg
  • 4.jpg

Be sure each image has the same extension (either all jpg, png, or gif), and that there are no gaps in the numbers. Also, place these images in their own folder to keep everything organized.

Write the Code

Now in the HTML of your page, insert the following code where you want an image to display:

<img src="/path/to/<?php echo rand(1,n);?>.jpg" alt="Random Image" />

The “rand” operator will display a randomly generated number between 1 and ‘n’. Change ‘n’ to the total amount of pictures you have arranged numerically (or the highest numbered picture you have). In the example above I only have 4 pictures, therefor I would change it to: rand(1,4);

To finish it off, change ‘/path/to/’ to the path your stored the images in.

10 Mar 2010

The Square HTML Special Character

Quick Tips No Comments

Displaying a simple square in HTML can be done by using the code:

&#9744

Example: ☐

05 Mar 2010

Will Desktops be Irrelevant in 3 years?

General No Comments

At a recent conference, European Director of Google’s online sales John Herlihy stated that in 3 years time, desktops will become irrelevant. The statement is not as farfetched as it sounds, in Japan that is already the case, where the only uses for desktops are in actual work environments, the vast majority of all other internet browsing is done on mobile devices.

With more data being moved to cloud services such as Amazon S3, the need for large hard drives for storage is becoming obsolete as well, being replaced by the convenience of accessing your data from anywhere on any device. Ever lose critical data or pictures from a hard drive failure? Cloud Services are built to prevent that from ever happening.

Concerned about the small screen size of your mobile device and the cramped keyboard? Try out the up-and-coming personal projectors along with the Sixth Sense Interface. Turn whatever surface/wall/table into your own 50″ monitor then control it by moving your hands and fingers in the air. It’s only a matter of time before mobile devices come with those features standard.

So will Desktops be irrelevant in 3 years? I’d say at least 5. It’s crucial to have those personal projectors and the Sixth Sense Interface perfected before that will ever happen. As soon as that does, I will happily replace my Desktop/Laptop with a single device that fits in my pocket.

Note: At this point in time I consider laptops to be the same as desktops, as majority of people who own laptops keep them in the same location, or never leave the house with them.

17 Feb 2010

Android Phones predicted to outsell iPhones by year’s end

General No Comments

In the planning stages for your next killer-iPhone app?

You might want to rethink the platform.

There are currently 60,000 Android phones being pushed out every day, says Google’s CEO Eric Schmidt. That comes out to over 21 million phones a year, a number that may help Android overtake the iPhone by the end of the year. While the numbers currently favor the iPhone, planning for the future will in all cases point to developing for Android.

15 Feb 2010

TED Talk on the upcoming Bing Maps

General No Comments

This TED Talk demonstrates the new Bing Map features that are far more advanced than any competitor. The most notable feature is the ability to stream live video that overlays the default Bing Map’s street views. This is amazing considering you could be browsing around cities and stores while at the same time seeing a live broadcast. This form of augmented reality completely revolutionizes the idea behind web cams, product launches, festivals, news reports, advertising, etc.

I didn’t catch a release date, however I will be posting updates as they come along.

05 Jan 2010

Public Google Apps Calendar showing “busy”

General 2 Comments

If you are trying to publicly display a calendar created through a Google Apps account, but all events are displaying as “busy”, follow these steps to allow the public to see all event details.

1) Login as an Administrator to your Google Apps account. (http://www.google.com/a/yourdomain.com)

2) At the dashboard, click “Calendar”.

3) Under “Sharing options”, change the “Outside this domain” setting to either of the “Share all informations”.

4) It will take an hour or two for the changes to take effect. When they do, you will now be able to change the “Sharing” settings on your calendar to allow the public to see the event details.

31 Dec 2009

Twitter’s Most Common Passwords

General No Comments

While locking down their security, Twitter posted a list of the 370 most used passwords by their users. I highly recommend looking at the list and changing your default password (for any email client, application, computer, etc) if it’s on there.

1. 111111
2. 11111111
3. 112233
4. 121212
5. 123123
6. 123456
7. 1234567
8. 12345678
9. 131313
10. 232323
11. 654321
12. 666666
13. 696969
14. 777777
15. 7777777
16. 8675309
17. 987654
18. aaaaaa
19. abc123
20. abc123
21. abcdef
22. abgrtyu
23. access
24. access14
25. action
26. albert
27. alexis
28. amanda
29. amateur
30. andrea
31. andrew
32. angela
33. angels
34. animal
35. anthony
36. apollo
37. apples
38. arsenal
39. arthur
40. asdfgh
41. asdfgh
42. ashley
43. august
44. austin
45. badboy
46. bailey
47. banana
48. barney
49. baseball
50. batman
51. beaver
52. beavis
53. bigdaddy
54. bigdog
55. birdie
56. bitches
57. biteme
58. blazer
59. blonde
60. blondes
61. bond007
62. bonnie
63. booboo
64. booger
65. boomer
66. boston
67. brandon
68. brandy
69. braves
70. brazil
71. bronco
72. broncos
73. bulldog
74. buster
75. butter
76. butthead
77. calvin
78. camaro
79. cameron
80. canada
81. captain
82. carlos
83. carter
84. casper
85. charles
86. charlie
87. cheese
88. chelsea
89. chester
90. chicago
91. chicken
92. cocacola
93. coffee
94. college
95. compaq
96. computer
97. cookie
98. cooper
99. corvette
100. cowboy
101. cowboys
102. crystal
103. dakota
104. dallas
105. daniel
106. danielle
107. debbie
108. dennis
109. diablo
110. diamond
111. doctor
112. doggie
113. dolphin
114. dolphins
115. donald
116. dragon
117. dreams
118. driver
119. eagle1
120. eagles
121. edward
122. einstein
123. erotic
124. extreme
125. falcon
126. fender
127. ferrari
128. firebird
129. fishing
130. florida
131. flower
132. flyers
133. football
134. forever
135. freddy
136. freedom
137. gandalf
138. gateway
139. gators
140. gemini
141. george
142. giants
143. ginger
144. golden
145. golfer
146. gordon
147. gregory
148. guitar
149. gunner
150. hammer
151. hannah
152. hardcore
153. harley
154. heather
155. helpme
156. hockey
157. hooters
158. horney
159. hotdog
160. hunter
161. hunting
162. iceman
163. iloveyou
164. internet
165. iwantu
166. jackie
167. jackson
168. jaguar
169. jasmine
170. jasper
171. jennifer
172. jeremy
173. jessica
174. johnny
175. johnson
176. jordan
177. joseph
178. joshua
179. junior
180. justin
181. killer
182. knight
183. ladies
184. lakers
185. lauren
186. leather
187. legend
188. letmein
189. little
190. london
191. lovers
192. maddog
193. madison
194. maggie
195. magnum
196. marine
197. marlboro
198. martin
199. marvin
200. master
201. matrix
202. matthew
203. maverick
204. maxwell
205. melissa
206. member
207. mercedes
208. merlin
209. michael
210. michelle
211. mickey
212. midnight
213. miller
214. mistress
215. monica
216. monkey
217. monkey
218. monster
219. morgan
220. mother
221. mountain
222. muffin
223. murphy
224. mustang
225. naked
226. nascar
227. nathan
228. naughty
229. ncc1701
230. newyork
231. nicholas
232. nicole
233. nipple
234. nipples
235. oliver
236. orange
237. packers
238. panther
239. panties
240. parker
241. password
242. password
243. password1
244. password12
245. password123
246. patrick
247. peaches
248. peanut
249. pepper
250. phantom
251. phoenix
252. player
253. please
254. pookie
255. porsche
256. prince
257. princess
258. private
259. purple
260. pussies
261. qazwsx
262. qwerty
263. qwertyui
264. rabbit
265. rachel
266. racing
267. raiders
268. rainbow
269. ranger
270. rangers
271. rebecca
272. redskins
273. redsox
274. redwings
275. richard
276. robert
277. rocket
278. rosebud
279. runner
280. rush2112
281. russia
282. samantha
283. sammy
284. samson
285. sandra
286. saturn
287. scooby
288. scooter
289. scorpio
290. scorpion
291. secret
292. sexsex
293. shadow
294. shannon
295. shaved
296. sierra
297. silver
298. skippy
299. slayer
300. smokey
301. snoopy
302. soccer
303. sophie
304. spanky
305. sparky
306. spider
307. squirt
308. srinivas
309. startrek
310. starwars
311. steelers
312. steven
313. sticky
314. stupid
315. success
316. summer
317. sunshine
318. superman
319. surfer
320. swimming
321. sydney
322. taylor
323. tennis
324. teresa
325. tester
326. testing
327. theman
328. thomas
329. thunder
330. thx1138
331. tiffany
332. tigers
333. tigger
334. tomcat
335. topgun
336. toyota
337. travis
338. trouble
339. trustno1
340. tucker
341. turtle
342. twitter
343. united
344. vagina
345. victor
346. victoria
347. viking
348. voodoo
349. voyager
350. walter
351. warrior
352. welcome
353. whatever
354. william
355. willie
356. wilson
357. winner
358. winston
359. winter
360. wizard
361. xavier
362. xxxxxx
363. xxxxxxxx
364. yamaha
365. yankee
366. yankees
367. yellow
368. zxcvbn
369. zxcvbnm
370. zzzzzz

Thanks TechCrunch for the list.

28 Dec 2009

Pre-Selecting Form Elements

Quick Tips No Comments

Checkboxes:

<input type="checkbox" name="test_box" value="1" checked />
<input type="checkbox" name="test_box" value="2" />

Radio Buttons

<input type="radio" name="test_radio" value="1" checked />
<input type="radio" name="test_radio" value="2" />

Dropdowns (<select>)

<select name="test_select">
   <option value="1" selected>Value 1</option>
   <option value="2">Value 2</option>
</select>
21 Dec 2009

The Easiest Way to Select All Checkboxes with jQuery

jQuery 1 Comment

After looking at many code samples online that were unnecessarily complex I’ve come up with my own simple method of selecting all checkboxes on a page:

$(":checkbox").attr("checked", true);

You can change the selector to target certain groups of checkboxes.

To deselect all checkboxes, simply change the “true” to “false”:

$(":checkbox").attr("checked", false);