Skip to content

Instantly share code, notes, and snippets.

View gauravpadia's full-sized avatar

Gaurav Padia gauravpadia

  • Rajkot, Gujarat India
View GitHub Profile
@kovshenin
kovshenin / something.php
Created July 10, 2012 07:17
Yes, you can use printf and sprintf in WordPress too!
<?php
// Dirty, easy to miss a ' or " or .
echo '<a href="' . get_permalink() . '" class="link">' . get_the_title() . '</a>';
// Clean, easier to read
printf( '<a href="%s" class="link">%s</a>', get_permalink(), get_the_title() );
// Almost as clean, and more secure, maybe a little paranoic :)
printf( '<a href="%s" class="link">%s</a>', esc_url( get_permalink() ), esc_html( get_the_title() ) );
@freyes
freyes / battery.lua
Created May 31, 2012 03:29
Awesome WM batery monitor
-- Modified by Felipe Reyes <[email protected]>
-- Original: http://awesome.naquadah.org/wiki/Acpitools-based_battery_widget
-- usage:
-- require("battery")
-- include "mybattmon" in your wibox
local naughty = require("naughty")
local time_rem = ""
mybattmon = widget({ type = "textbox", name = "mybattmon", align = "right" })
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.