Skip to content

Instantly share code, notes, and snippets.

@magemore
magemore / gist:2486564
Created April 25, 2012 04:59
Adding Google fonts
<!-- Some special fonts -->
/* Single font load*/
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif">
/* Multiple font load*/
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Nobile|Droid+Serif|Old+Standard+TT|Droid+Sans"><!-- Some special fonts -->
@magemore
magemore / gist:2486578
Created April 25, 2012 05:00
Flipping an image – transform
img.flip {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
@magemore
magemore / gist:2486596
Created April 25, 2012 05:01
Rotating an image or text – transform
/* for firefox, safari, chrome, and any other gecko/webkit browser */
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
/* for ie */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
/* opera */
-o-transform: rotate(30deg);
@magemore
magemore / gist:2486608
Created April 25, 2012 05:02
Changing the size of your content area
#content {
width: 100%;
margin: 0;
float: none;
}
@magemore
magemore / gist:2486610
Created April 25, 2012 05:02
Comprehensive List of Browser-Specific CSS Hacks
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
@magemore
magemore / gist:2486614
Created April 25, 2012 05:03
Eric Meyers CSS reset
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
@magemore
magemore / categories-api.php
Created May 26, 2012 18:40
Using Magento API to create categories
<?php
class Categories
{
private $client;
private $session;
private $tree;
private $categories;
public function __construct()
@magemore
magemore / gist:4499587
Created January 10, 2013 04:56
Amazon Linux AMI (Fedora) install htop
# update
sudo yum -y update
sudo yum -y upgrade
# enable EPEL6 by changing enabled=0 -> enabled=1
sudo vim /etc/yum.repos.d/epel.repo
# install htop
sudo yum install htop
@magemore
magemore / php_str_replace.cpp
Last active February 2, 2016 21:24
c++ php str_replace analog using std string
std::wstring str_replace(std::wstring search, std::wstring replace, std::wstring subject)
{
std::wstring result = subject;
if (subject.length() == 1) {
if (subject == search) return replace;
}
else if (subject.length() > 1) {
std::string::size_type start_pos = 0;
std::string::size_type search_length = search.length();
std::string::size_type replace_length = replace.length();
@magemore
magemore / open.js
Created March 1, 2016 01:20
playing testing site with phantomjs
console.log('Loading a web page');
var page = require('webpage').create();
page.viewportSize = { width: 1000, height: 500 };
page.clipRect = {
top: 0,
left: 0,
width: 1000,
height: 800
};
var url = 'http://www.example.com/admin/';