Skip to content

Instantly share code, notes, and snippets.

View panoply's full-sized avatar
🥛
Rich in the hood

ΝΙΚΟΛΑΣ panoply

🥛
Rich in the hood
View GitHub Profile
@iamraffe
iamraffe / Lravel-5-inpalce-edit-using-xeditable.php
Created October 23, 2015 13:20 — forked from pupadupa/Lravel-5-inpalce-edit-using-xeditable.php
Laravel 5 inplace editing using jquery's x-editable plugin . Inline and bulk editing examples.
/**
*
* In this example we create view with inplace and bulk editing.
* Tools and plugins:
* jQuery
* xEditable jquery plugin
* twitter bootstrap
*
*/
@mabasic
mabasic / helpers.php
Last active April 27, 2024 14:07
config_path function for Lumen framework
<?php
if ( ! function_exists('config_path'))
{
/**
* Get the configuration path.
*
* @param string $path
* @return string
*/
@ajaegers
ajaegers / git-move-files-in-subfolder.md
Last active February 17, 2024 13:28
Git: move files in an subfolder keeping history

Change structure of project folder with Git

I have this structure:

 project-folder/
     .git
     wp-admin/
     wp-content/
     wp-includes/

.htaccess

@DanWebb
DanWebb / addItems.js
Created January 30, 2015 18:29
Shopify only allows us to make a single call at a time adding one item at a time. Here's a method to add multiple items to the cart at once which works around that.
// add multiple items to the cart by passing an array of item objects
function addItems(items, callback) {
if(!items.length) {
// we ran out of items
if(typeof callback === 'function') callback();
return;
}
$.ajax('/cart/add.js', {
type:'POST',
@schaeken
schaeken / collection-sidebar.liquid
Last active November 18, 2021 13:40
Control the display order of tag groups lists in the collection sidebar using Supply's 'advanced tag filtering' - and control the sort order of the list items within that group using a link list.
<div class="grid-uniform">
{% assign group_array = settings.group_array | split: ',' %}
{% for group in group_array %}
{% if cat_array contains group %}
{% capture array %}{% unless array == blank or array == "" %}{{ array }},{% endunless %}{{group | strip}}{% endcapture%}
{% endif %}
{% endfor%}
{% assign cat_array = array | split:',' %}
{% comment %}
@chrisgrabinski
chrisgrabinski / shopify-auto-currencies-switcher.js
Last active January 16, 2023 20:04
(Shopify) Automatically change a shop's currency based on the customer's geolocation
// Dependencies
// - https://github.com/carolineschnapp/currencies
// Don't change currency if Cookie has been already set
if (Currency.cookie.read() == null) {
jQuery.ajax( {
url: '//freegeoip.net/json/',
type: 'GET',
dataType: 'jsonp',
@lifesign
lifesign / install.sh
Created November 25, 2014 03:32
Installing Homestead 2.0 on a Mac
# Add Homestead Vagrant box
vagrant box add laravel/homestead
# Install PHP 5.6 and Composer
brew update
brew tap homebrew/dupes
brew tap homebrew/php
brew install php56
brew install composer
@lucased
lucased / shopify-add-to-cart
Created October 30, 2014 11:03
Shopify - Add product to cart automatically
if (typeof Shopify === 'undefined') var Shopify = {};
Shopify.cart = {{ cart | json }};
Shopify.toAdd = 378589397;
var surchargeInCart = false;
var total = 2507; // total in cents.
for (var i=0; i<Shopify.cart.items.length; i++) {
if (Shopify.cart.items[i].id === Shopify.toAdd) {
surchargeInCart = true;
total -= Shopify.cart.items[i].line_price;
@tracker1
tracker1 / 01-directory-structure.md
Last active April 26, 2024 21:26
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>