Skip to content

Instantly share code, notes, and snippets.

View haroldao's full-sized avatar
🎯
Design + Dev

Harold AO haroldao

🎯
Design + Dev
View GitHub Profile
@zoerooney
zoerooney / jquery.js
Last active August 15, 2023 02:21
Shopify minicart on non-Shopify site
<script>
jQuery.ajax({
type: 'GET',
url: 'http://mysite.myshopify.com/cart.json',
dataType: 'jsonp',
success: function(data) {
var item_count = data['item_count'];
var total_price = data['total_price']/100;
//If there are items in cart
@carolineschnapp
carolineschnapp / Add Color Swatches using hex values.md
Last active August 5, 2024 10:32
Add Color swatches to #Brooklyn theme. Use hexadecimal values or images.

What we want

We want to go from this:

Alt text

... to that:

Alt text

@juancabrera
juancabrera / getCubicBezier.jsx
Last active April 25, 2021 01:43
After Effect Script for getting the cubic-bezier (css friendly) of a specific layer's transition
// Source:
// https://forums.adobe.com/thread/1471138
function getCubicbeziers(){
var curItem = app.project.activeItem;
var selectedLayers = curItem.selectedLayers;
var selectedProperties = app.project.activeItem.selectedProperties;
if (selectedLayers == 0){
alert("Please Select at least one Layer");
} else if(selectedLayers !=0){
@vladimir-rybalko
vladimir-rybalko / get-weather-by-geolocation.html
Last active November 11, 2022 22:01 — forked from marchawkins/get-weather-by-geolocation.html
Using the OpenWeatherMap and HTML 5 geolocation APIs to get the current weather for the user's current location. The location is determined by the user's system. Due to privacy concerns, the user must give permission for the browser to access the location. If the user disallows location access, the lat/long retrieved is based on the user's ip ad…
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-2">
<p><button class="btn btn-primary btn-sm" id="get-weather-btn"><span>Get Weather</span></button></p>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">Weather &amp; Location Response</div>
<div class="panel-body">
<p>Lat/Long: <input id="location-lat-long" type="text" class="form-control"/></p>
<p>Weather: <textarea id="weather" class="form-control"></textarea></p>
Here are a few questions that will tee us up for a good conversation:
- Can you tell me about your project in a few sentences?
- What’s the timeframe? Does a certain event depend on this project launching?
- What are you looking for from us? Do you want us to design, build, and launch the whole site? Or do you have developers or other partners lined up and only need us for design?
- Have you already started on any part of the project? Do you have existing work? A new logo? Some rough designs or ideas for the site?
- How large is your team? What are the roles you envision on your end?
- How did you hear about our work? What specifically interests you about it? Any projects that you’re keen on?
- How much money have you set aside for this project?
- Are you talking to others about this project? Might we ask how many? What do you like about their work?
@biilmann
biilmann / readme.md
Created October 14, 2015 22:07
Quick Guide to Private NPM Modules on Netlify

Using NPM Private Modules on Netlify

Create a .npmrc file for your project like this:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

Then find your token inside the ~/.npmrc file in your home folder and set it as an NPM_TOKEN environment variable through netlify's admin UI.

@gokulkrishh
gokulkrishh / media-query.css
Last active May 7, 2025 06:24
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@rickydazla
rickydazla / ajax-submit-form.js
Created December 10, 2015 03:13
Shopify AJAX Form submit
/* Build the Shopify Parameters
//---------------------------------------*/
var action = '/contact?';
action += encodeURIComponent('form_type') +'='+ encodeURIComponent('contact');
action += '&'+ encodeURIComponent('utf8') +'='+ encodeURIComponent('✓');
action += '&'+ encodeURIComponent('contact[email]') +'='+ encodeURIComponent(contact_email);
action += '&'+ encodeURIComponent('contact[body]') +'='+ encodeURIComponent(contact_body);
/* Submit the form
//---------------------------------------*/
@alopresto
alopresto / Merging PR for 2 branches
Last active May 15, 2024 15:16
Instructions to merge pull requests for multiple branches (master, support, etc.)
#Steps to merge/close pull requests with two main branches
As NiFi now has a 1.0 (master) and 0.x (support) branch, pull requests (PR) must be applied to both. Here is a step-by-step guide for committers to ensure this occurs for all PRs.
1. Check out the latest master
``` $ git checkout master
$ git pull upstream master
```
2. Check out the PR (example #327). This will be in `detached-HEAD` state. (Note: You may need to edit the `.git/config` file to add the `fetch` lines [below](#fetch))
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>