Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
-- 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" }) |
<?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() ) ); |
<?php | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - 2012-2018 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit', '1024M'); |
# You will need latest NVIDIA drivers installed. At the time of writing, version is 331.20. | |
# On ubuntu 13.10, it looks like this: | |
sudo add-apt-repository ppa:xorg-edgers/ppa | |
sudo apt-get update | |
sudo apt-get install nvidia-331 | |
# Now we need to install bumblebee: | |
sudo add-apt-repository ppa:bumblebee/stable | |
sudo apt-get install bumblebee bumblebee-nvidia bbswitch-dkms |
NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.
I'd like to hear how you approach this: @valuedstandards or comment on this gist.
You have to include a boatload of link
elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':
/** | |
* Convert html into correct element | |
* @param html | |
*/ | |
html2element: function(html) { | |
var attributes = {}, | |
$template; | |
if (_.isString(html)) { | |
this.template = _.template(html); | |
$template = $(this.template(this.model.toJSON(), vc.templateOptions.default).trim()); |
# To get the `action` prop: | |
# | |
# 1. Go to your dashboard on mailchimp.com and navigate | |
# to Lists > Signup Forms > Embedded Forms. | |
# | |
# 2. Copy the `<form>` action from the generated HTML code. | |
# | |
# 3. Pass that into the component via the prop, like so: | |
# | |
# <mailchimp-subscribe |