Skip to content

Instantly share code, notes, and snippets.

@thinkingcap
thinkingcap / install nginx
Last active August 29, 2015 14:04
Magento setup tasks
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php55-fpm
# Install PHP extensions
sudo yum install php55-fpm php55-mysql php55-common \
php55-mcrypt php55-gd php55-curl php55-json php55-soap
@thinkingcap
thinkingcap / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
@thinkingcap
thinkingcap / gist:855ebc7618909321a5e7
Created December 28, 2014 06:29
List all NPM global packages
npm ls -gp | awk -F/ '/node_modules/ && !/node_modules.*node_modules/ {print $NF}'
-- Delete all
npm ls -gp | awk -F/ '/node_modules/ && !/node_modules.*node_modules/ {print $NF}' | xargs npm -g rm
-- Alt
npm ls -gp --depth=0 | awk -F/node_modules/ '{print $2}' | grep -vE '^(npm|)$' | xargs npm -g rm
@thinkingcap
thinkingcap / upgrade_curl.sh
Created February 6, 2017 23:54
Upgrade curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Dec 23, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.52.1.tar.bz2
tar -xvjf curl-7.52.1.tar.bz2
@thinkingcap
thinkingcap / sync_mail.sh
Created February 21, 2017 15:03 — forked from dalethedeveloper/sync_mail.sh
Transferring to/from Gmail accounts to a Google Apps account with imapsync. Also good for GApps to GApps transfers, archives, or migrations.
#/!/bin/bash
# Most of the tweaks here are wrapped up in gmailmig
# https://code.google.com/p/gmailmig/
#
# Props to brave folks who figured this out before me
# http://imapsync.lamiral.info/FAQ
# http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration
# http://seagrief.co.uk/2010/12/moving-to-google-apps-with-imapsync/
# http://blog.mcfang.com/tag/imapsync/
#
#! /bin/sh
# Usage A:
# optimise-images.sh /path/dir
#
# Usage B:
# cd /images/dir
# optimise-images.sh
EXT="jpe?g"
curl -u admin:readynas -k -d command=poweroff -d shutdown_option=1 -d OPERATION=set -d PAGE=System -d OUTER_TAB=tab_shutdown -d INNER_TAB=none https://10.20.0.102/get_handler
<!-- Page title -->
<section id="page-title" style="background-image: url('[%asset_url type:'content' thumb:'thumb' id:'[@content_id@]' default:'/assets/images/default_category_header.jpg' /%]'); background-repeat: no-repeat">
<div>
<div class="page-title">
<h1>
Search EarthingOz
</h1>
</div>
</div>
</section>
@thinkingcap
thinkingcap / node-eslint-setup.sh
Last active July 4, 2018 11:35
Node & eslint
# Node & npm
touch ~/.bashrc
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install 8
npm install -g npm@latest
# ESLint
npm install -g eslint eslint-plugin-html eslint-plugin-markdown eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-import
@thinkingcap
thinkingcap / woocommerce-upsells-shortcode.php
Created July 14, 2019 00:55 — forked from bekarice/woocommerce-upsells-shortcode.php
WooCommerce Upsells Shortcode: outputs product upsells when the [woocommerce_product_upsells] shortcode is used
<?php
/**
* Plugin Name: WooCommerce Upsells Shortcode
* Plugin URI: http://skyver.ge/51
* Description: Adds a shortcode to output WooCommerce product upsells; removes them from the original location when used
* Author: SkyVerge
* Author URI: https://www.skyverge.com/
* Version: 1.0.0
*
* Copyright: (c) 2016 SkyVerge, Inc. (info@skyverge.com)