Skip to content

Instantly share code, notes, and snippets.

View floq-design's full-sized avatar

James Hobson floq-design

View GitHub Profile
@floq-design
floq-design / gist:2646328
Created May 9, 2012 16:33
Actionscript2: swfobject with flashvars and wmode params
<script type="text/javascript">
//<![CDATA[
var params = {
wmode: 'transparent'
};
var flashvars = {};
flashvars.brand_id = "<!--{brand_id}-->";
flashvars.gender = "<!--{gender}-->";
swfobject.embedSWF("images/product-explorer.swf", "productExplorerApp", "595", "477", "8.0.0", "images/expressInstall.swf", flashvars, params);
@floq-design
floq-design / Wordpress - twitter feed with cache
Created July 14, 2012 07:39
Wordpress twitter feed with cache template fragment
<?php
// source: http://spaceninja.com/2009/07/twitter-php-caching/
//
// define $twitterUsername and $twitterTweets in functions.php
//
global $twitterUsername, $twitterTweets;
define("SECOND", 1);
define("MINUTE", 60 * SECOND);
define("HOUR", 60 * MINUTE);
@floq-design
floq-design / Wordpress - ninjaform.less
Created July 18, 2012 15:24
LESS styles for Ninja Forms plugin for Bones theme for Wordpress
#ninja_form {
&.ninja-success {
font-size: 1.6em;
line-height: 1.6em;
}
}
/* popup overlay */
.ui-widget-overlay {
@floq-design
floq-design / Wordpress - set TinyMCE colors
Created July 19, 2012 08:28
Change color options in TinyMCE
// change buttons in WYSWIG post editor, edit color palette
function change_mce_options( $init ) {
$init['theme_advanced_text_colors'] = 'bf2113,0f3a62,292929,000,FFF,d8d8d8,999';
// $init['theme_advanced_more_colors'] = false;
return $init;
}
add_filter('tiny_mce_before_init', 'change_mce_options');
@floq-design
floq-design / Wordpress - convert decimal to roman numerals
Created July 19, 2012 08:29
Convert decimal to roman numerals
/*integer to roman numeral converter*/
function numberToRoman($num) {
// Make sure that we only use the integer portion of the value
$n = intval($num);
$result = '';
// Declare a lookup array that we will use to traverse the number:
$lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
@floq-design
floq-design / TipTip LESS CSS
Created October 12, 2012 14:28
TipTip LESS CSS
/*=======================================================*/
/* TIPTIP START */
/*=======================================================*/
/* TipTip CSS - Version 1.2 */
#tiptip_holder {
display: none;
position: absolute;
top: 0;
left: 0;
@floq-design
floq-design / gist:5532413
Created May 7, 2013 13:07
Mix 2 hexadecimal colours with strength control. Code credit: http://www.syndrotech.com/programming/php-mix-two-hex-colors/
<?php
function mixColors($color1, $color2, $strength = 0.5) {
$strengthOppose = 1 - $strength;
$color1_red = hexdec(substr($color1, 0, 2));
$color1_green = hexdec(substr($color1, 2, 2));
$color1_blue = hexdec(substr($color1, 4, 2));
$color2_red = hexdec(substr($color2, 0, 2));
$color2_green = hexdec(substr($color2, 2, 2));
@floq-design
floq-design / gist:5540808
Created May 8, 2013 14:27
List maker using javascript to output to HTML.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>List Maker</title>
<script>
var prefix = "bingo_", // prefix
extension = ".bmp", // file extension
suffix = " 9", // output suffix
countStart = 10, // start number
@floq-design
floq-design / _flexslider.scss
Created June 1, 2013 08:29
Flexslider v2.0 CSS ported to SCSS
/*
* jQuery FlexSlider v2.0
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (@mbmufffin)
*/
@floq-design
floq-design / _jquery.lightbox.scss
Created June 6, 2013 16:36
Jquery Lightbox CSS to SCSS with compass
/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
.fancybox-wrap,
.fancybox-skin,
.fancybox-outer,
.fancybox-inner,
.fancybox-image,
.fancybox-wrap iframe,
.fancybox-wrap object,
.fancybox-nav,
.fancybox-nav span,