Skip to content

Instantly share code, notes, and snippets.

View raulbrito's full-sized avatar

Raul Brito raulbrito

View GitHub Profile
@raulbrito
raulbrito / get_latest_changes_from_shopify.sh
Created January 28, 2016 05:44
Update repository with latest changes from the Shopify side
git status # make sure you don't have any changes locally
theme download # get the latest version from the shopify servers
git add . # adds all the changed files to be commited
git commit -m "commit changes from server" # commits all changes made since last time
git push origin master # pushes the changes to the remote repository
@raulbrito
raulbrito / update_repo.sh
Created January 28, 2016 05:40
Add commit to repo with latest changes
git status # allows to see the changes made
git add . # to add all the changed files. you can also add them one by one
git commit -m "description of changes made" # commits the changes locally
git push origin master # or any other remote repository and branch to you prefer
theme configure f3d64ec79d0d8339d745208bf382bd85 2526f780336b9284ee980d630c36bc2f thundercat.myshopify.com 84991510 # this create a configuration file (config.yml)
theme download # this downloads all the corresponding theme files to your computer
git init . # this creates a local git repository
git add . && git commit -m "first commit" # adds all the files to the local repository
require 'pusher-client'
require 'sqlite3'
require 'json'
db = SQLite3::Database.open "blackfriday.db"
#rows = db.execute <<-SQL
# create table orders (
# from_latitude int,
# from_longitude int,
@raulbrito
raulbrito / theme.liquid
Last active August 29, 2015 14:25
VAT rates for Shopify - multiple variants
<!-- make sure to apply the changes for the single variant approach
before making these changes for multi-variant.
Single variant approach is implemented here: https://gist.github.com/raulbrito/581678194f109efbe1d4
-->
var selectCallback = function(variant, selector) {
if (variant) {
if (variant.featured_image) {
var newImage = variant.featured_image;
@raulbrito
raulbrito / cart.liquid
Last active August 29, 2015 14:25
VAT rates for Shopify - single variant
<tbody>
{% for item in cart.items %}
<tr>
<td class="image">
<div class="product_image">
<a href="{{ item.url }}">
<img src="{{ item | img_url: 'small' }}" alt="{{ item.title | escape }}" />
</a>
</div>
</td>
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
$ sudo gem install rack
$ sudo gem install sinatra
$ sudo gem install shotgun
package ca.jbrains.pos.test;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.*;
public class SellOneItemTest {
public static class Sale {
package calculator;
public class CalculatorController {
private final CalculatorModel model;
private Calculation calculation;
public CalculatorController(CalculatorModel model, Calculation calculation) {
this.model = model;