Skip to content

Instantly share code, notes, and snippets.

@jduff
jduff / @shopify+cli-kit+3.55.1.patch
Created February 12, 2024 13:28
@shopify/cli Patch to allow liquid templating in toml files
diff --git a/node_modules/@shopify/cli-kit/dist/public/node/toml.js b/node_modules/@shopify/cli-kit/dist/public/node/toml.js
index a3c4503..8e26498 100644
--- a/node_modules/@shopify/cli-kit/dist/public/node/toml.js
+++ b/node_modules/@shopify/cli-kit/dist/public/node/toml.js
@@ -1,13 +1,28 @@
import * as toml from '@iarna/toml';
+import {Liquid} from 'liquidjs';
+import {readAndParseDotEnv } from './dot-env.js'
+import {fileExists} from './fs.js'
+import {joinPath, cwd} from './path.js'
@jduff
jduff / auths_controller.rb
Last active January 6, 2024 19:28
Basic Shopify OAuth implementation in Ruby
class Shopify::AuthsController < ApplicationController
NONCE_LENGTH = 15
AUTH_COOKIE_NAME = "_shopify_auth_session"
before_action :verify_request_hmac, only: :callback
before_action :verify_request_state, only: :callback
def new
# TODO: Check if we have a token already or if scopes have changed
if params[:embedded]
# Apply to Shopify API #
Interested in working at Shopify? Don't use that form, you're a
developer and can clearly do better than that!
Instead you can apply to Shopify via our applicant API. Of course,
for the extra effort you will be given a higher priority than those
who simply apply via the webform.
# How? #
# pretty colors
set -g default-terminal "screen-256color"
# default tmux key
unbind-key C-b
set -g prefix C-a
set -g base-index 1
set -g history-limit 100000
@jduff
jduff / base.css
Created September 6, 2010 16:08
base css file
/* base.css */
/* http://carsonified.com/blog/design/setting-rather-than-resetting-default-styling/ */
/* http://developer.yahoo.com/yui/fonts/ */
/* http://developer.yahoo.com/yui/base/ */
/* Font Reset from YUI http://developer.yahoo.com/yui/fonts
If you want this size in pixels (px) Declare this percent (%)
10 77
11 85
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
<script>
$(document).ready(function(){
function debug(str){ $("#debug").append("<p>" + str + "</p>"); };
function send_msg_string(str) {
$("#msg").append("<p>[ OUT ]"+str+"</p>");
ws.send(str+"\n");
}
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
end
#env
export PATH=/opt/local/bin:/opt/local/sbin:$PATH:/usr/local/mysql/bin
# git aliases
alias gst="git status"
alias gp="git push"
alias gl="git pull"
alias gc="git commit -m"
alias ga="git add"
#import <Foundation/Foundation.h>
@interface PolygonShape : NSObject {
int numberOfSides;
int minimumNumberOfSides;
int maximumNumberOfSides;
}
@property (assign) int numberOfSides;
@property (assign) int minimumNumberOfSides;
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// insert code here...
NSLog(@"Hello, World!");
NSString *path = @"~";
path = [path stringByExpandingTildeInPath];