Skip to content

Instantly share code, notes, and snippets.

View jasonruyle's full-sized avatar

Jason Ruyle jasonruyle

View GitHub Profile
@jasonruyle
jasonruyle / .bash_profile
Created August 15, 2012 19:02
Install composer as system wide tool on OSX
alias composer="php /usr/local/bin/composer.phar"
@jasonruyle
jasonruyle / _0mixins.scss
Last active December 14, 2015 14:49
Sass Mixins
/*----------------------------------------------------------------------------
@group Mixins
----------------------------------------------------------------------------*/
// Creates a background image with width and height dynamically.
//
// $_img - The path to the image.
//
// Compatible in IE8+, Firefox 2+, Safari 4+.
@mixin knockout($_img) {
config.json
reading-image.png
config.json
reading-image.png
@jasonruyle
jasonruyle / iptables_redis_mongo
Created April 17, 2013 19:52
Securing mongodb and redis on ubuntu
# Run in a shell for each service
port="6379" # REDIS Port: 6379
#port="27017" # MONGO Port: 27017
server="servername.com"
iptables -A INPUT -s $servername.com -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -s localhost -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport $port -j DROP
# Control your Rules with iptables -L
/* Expect the hover class to be on the body
before doing any hover effects */
.hover .block:hover {
}
@jasonruyle
jasonruyle / commerce_rules_line_item_loop.php
Created January 14, 2014 18:03
Drupal Commerce Rules: Loop through Commerce Line Items
<?php
// Use the code inside rule conditions with a Custom PHP code
// FIELD_MACHINE_NAME example: field_product_free_shipping
global $user;
$commerce_order = commerce_cart_order_load($user->uid);
$line_items = $commerce_order->commerce_line_items['und'];
foreach ($line_items as $lid) {
$line_item = commerce_line_item_load($lid['line_item_id']);
if ( isset($line_item->commerce_product)) {
$pid = $line_item->commerce_product['und'][0]['product_id'];
@jasonruyle
jasonruyle / UFW_ban_country.md
Last active May 26, 2024 22:06
UFW to block countries
@jasonruyle
jasonruyle / tic-dashboard.json
Last active August 29, 2015 14:06
TIC Dashboard
{
"title": "TIC Dashboard",
"services": {
"query": {
"list": {
"0": {
"query": "severity=info",
"alias": "",
"color": "#7EB26D",
"id": 0,
@jasonruyle
jasonruyle / apply-price-rules.php
Created January 17, 2017 18:36 — forked from Sleavely/apply-price-rules.php
Programmatically apply catalog price rules in Magento
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
// Bootstrap Magento
require '../magento/app/Mage.php';
Mage::app('admin', 'store');
try{
$catalogPriceRule = Mage::getModel('catalogrule/rule');