Skip to content

Instantly share code, notes, and snippets.

View leoken's full-sized avatar

Erik James Albaugh leoken

  • Maintain Web
  • Long Beach, CA
  • X @leoken
View GitHub Profile
/* Convert hexdec color string to rgb(a) string */
function hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
//Return default if no color provided
if(empty($color))
return $default;
.video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; }
.video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; }
.video:after { content: ""; position: absolute; display: block;
background: url(play-button.png) no-repeat 0 0;
top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* image poster clicked, player class added using js */
.video.player img { display: none; }
.video.player:after { display: none; }
CREATE TABLE `wp_term_taxonomy` (
`term_taxonomy_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`taxonomy` varchar(32) NOT NULL DEFAULT '',
`description` longtext NOT NULL,
`parent` bigint(20) unsigned NOT NULL DEFAULT '0',
`count` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`term_taxonomy_id`),
UNIQUE KEY `term_id_taxonomy` (`term_id`,`taxonomy`),
KEY `taxonomy` (`taxonomy`)
#!/bin/bash
NODE=/opt/node/bin/node
SERVER_JS_FILE=/home/pi/app/server.js
USER=pi
OUT=/home/pi/nodejs.log
case "$1" in
start)
@leoken
leoken / .gitignore
Created November 11, 2013 10:31 — forked from redoPop/.gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
<style type="text/css">
 
.acf-map {
width: 100%;
height: 400px;
border: #ccc solid 1px;
margin: 20px 0;
}
 
</style>
delete a,b,c,d
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =<category id>
browser.names = c("Internet Explorer", "Firefox", "Chrome", "Safari", "Opera", "Mobile", "Others")
browser.years = c(
2013.417, 2013.333, 2013.25, 2013.167, 2013.083, 2013,
2012.917, 2012.833, 2012.75, 2012.667, 2012.583, 2012.5, 2012.417, 2012.333, 2012.25, 2012.167, 2012.083, 2012,
2011.917, 2011.833, 2011.75, 2011.667, 2011.583, 2011.5, 2011.417, 2011.333, 2011.25, 2011.167, 2011.083, 2011,
2010.917, 2010.833, 2010.75, 2010.667, 2010.583, 2010.5, 2010.417, 2010.333, 2010.25, 2010.167, 2010.083, 2010,
2009.917, 2009.833, 2009.75, 2009.667, 2009.583, 2009.5, 2009.417, 2009.333, 2009.25, 2009.167, 2009.083, 2009,
2008.917, 2008.833, 2008.75, 2008.667, 2008.583)
browser.ie = c(
SELECT *
FROM (
SELECT
`wp_posts`.`ID` ,
`wp_posts`.`post_title` AS `Title`,
`wp_posts`.`post_date` AS `Date`,
MAX( CASE WHEN `wp_postmeta`.`meta_key` = 'useremail'