Skip to content

Instantly share code, notes, and snippets.

@bxmas13
bxmas13 / newvhost.sh
Last active June 11, 2019 19:09 — forked from mattmezza/vhost.sh
bash script to create virtual host vhost with apache httpd and CentOs 7
#!/bin/bash
# This script is used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Further Improved by bxmas13 from https://brianchristmas.com
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files
@ccashwell
ccashwell / getDiscountCode.html
Last active January 19, 2023 15:25
Autofill Discount Code from Shopify URL
<script>
/* Put this in theme.liquid, preferably right before "</body>" */
(function() {
var discountParam = document.location.search.match(/discount=(\w+)/);
if (discountParam && discountParam.length > 1) {
document.cookie = discountParam[0];
}
})();
</script>
@tmslnz
tmslnz / gulpfile.js
Last active October 26, 2021 02:30
Complete example gulpfile.js for https://github.com/tmslnz/gulp-shopify-theme
/*
Streamlined Shopify theme development.
NOTE: depends on module gulp-shopify-theme
npm install --save-dev yargs gulp gulp-sass gulp-changed gulp-sourcemaps gulp-autoprefixer gulp-uglify gulp-concat gulp-replace gulp-plumber gulp-babel browser-sync gulp-if del gulp-add-src gulp-rename gulp-yaml gulp-shopify-theme
Highlights:
- https proxying via BrowserSync
@dfrdmn
dfrdmn / remarketing.liquid
Last active April 28, 2017 19:23
Google remarketing code for Shopify
{% comment %}Create a file called `google-remarketing.liquid` in the snippets subdirectory of your template with the following code. Be sure to insert your merchant ID.{% endcomment %}
{% if template contains 'index' %}
<script type="text/javascript">
var google_tag_params = {
ecomm_pagetype: 'home',
};
</script>
{% elsif template contains 'collection' %}
<script type="text/javascript">
var google_tag_params = {
@izzyaxel
izzyaxel / TEBlackHole.java
Last active June 3, 2018 19:04
The TIleEntity for a 'black hole' type of block
public class TEBlackHole extends TileEntity
{
//I use constant variables for this sort of thing
final int PULLRADIUS = 20;
final int KILLRADIUS = 3;
//Should updateEntity() be called?
@Override
public boolean canUpdate()
{
@greggnakamura
greggnakamura / eventUtility.js
Created February 1, 2015 20:44
Javascript: Feature Detection, Cross-Browser Event Handling example
// eventUtility.js
var eventUtility = {
addEvent: function (el, type, fn) {
/*
el: HTML element object (DOM object)
type: event type to listen to
fn: function
*/
@mattmezza
mattmezza / vhost.sh
Last active November 30, 2023 08:30
bash script to create virtual host vhost with apache httpd and CentOs 7
#!/bin/bash
# This script is used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files
# $servn - webserver address without www.
@pepelsbey
pepelsbey / duplicates.html
Last active June 28, 2019 12:15
Removing duplicates from Liquid array
{% assign array = 'c|c|b|b|a|a' | split: '|' %}
{% assign tags = array[1] %}
{% for item in array %}
{% unless tags contains item %}
{% capture tags %}{{ tags }}|{{ item }}{% endcapture %}
{% endunless %}
{% endfor %}
{{ tags | split: '|' | sort | join: ', ' }}
@tobysteward
tobysteward / BlogController.php
Last active March 4, 2024 23:11
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){