Skip to content

Instantly share code, notes, and snippets.

View rickbenetti's full-sized avatar

Rick Benetti rickbenetti

View GitHub Profile
@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 19, 2024 21:54
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@g3d
g3d / gist:2709563
Last active February 7, 2024 15:21 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@geedelur
geedelur / capistrano_windows.textile
Created July 30, 2012 16:13
Cygwin + Ruby + RubyGems => Deploy with Capistrano from Windows
@oazabir
oazabir / .htaccess
Created May 13, 2013 16:15
Pretty robust .htaccess file, especially for wordpress. Supports extension less URL (permalinks), strong security, caches static content aggressively
ErrorDocument 404 /
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
@hans2103
hans2103 / price.phtml M1.8
Last active December 29, 2015 02:49
Implementation of structured data itemprop=price on app/design/frontend/<your_package>/<your_theme>/template/catalog/product/price.phtml - Magento 1.8.0.0 - http://schema.org/Offer - more information: http://www.byte.nl/blog/magento-rich-snippets-made-easy/
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@adamwalz
adamwalz / adamwalz.net.nginxconf
Last active July 16, 2019 05:31
Jekyll optimized nginx server configuration used on adamwalz.net
server {
server_name www.adamwalz.net;
return 301 $scheme://adamwalz.net$request_uri;
}
server {
server_name adamwalz.net *.adamwalz.net;
root /home/adamwalz/Sites/adamwalz.net;
access_log /var/log/nginx/adamwalz.net/access.log;
@jasontipton
jasontipton / price.phtml
Created November 17, 2014 01:27
Adding 'hreview-aggregate' Microformat - Magento 1.9 Community Edition
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
{
"name": "mynamespace/myproject",
"description": "Composer file example",
"repositories": [
{
"type": "composer",
"url": "http://drupal-packagist.webflo.io/"
},
{
"type": "package",