Skip to content

Instantly share code, notes, and snippets.

View cbodtorf's full-sized avatar

ケーレブ cbodtorf

View GitHub Profile
@benmoss
benmoss / instructions.md
Created September 22, 2024 15:29
instructions on how to install the Ergatta app on a different Android tablet/device

Since several people have asked I'll post how anyone can do this, and it's not actually that complicated since I've already gotten the apk file and so can share that.

  1. If you don't already have a tablet you want to use you'll need to get one, I got the Amazon Fire HD 10
  2. On the Android device you want to use as your new Ergatta device download the Ergatta apk file from either my Google Drive or this short URL version of it: https://shorturl.at/IbRzJ
  3. You can use Chrome or whatever browser you have (Amazon Silk, etc). You might need to bypass some security restrictions on the device to download install this file. On my Fire's Silk Browser it prompted me that installing this app might be dangerous etc, but shows you how to bypass.
  4. Remove the old Ergatta tablet from your rower
  5. Attach the USB cable that was going into your old tablet into your new tablet, I'm using one of
/*------------------------
Libraries
------------------------*/
const axios = require("axios");
const fs = require("fs");
const FormData = require("form-data");
/*------------------------
Download the file.
Good article on how to download a file and send with form data - https://maximorlov.com/send-a-file-with-axios-in-nodejs/
@andrewlaskey
andrewlaskey / OxiSocialLogin.vue
Last active February 5, 2020 02:28
Oxi Social Login Nacelle Component
<template>
<div class="login">
<div
v-if="showIframe"
class="oxi_social_wrapper"
>
<iframe
id="social_login_frame"
:src="iframeSrc"
style="width:100%;max-width:100%;padding-top:0px;margin-bottom:5px;border:0px;height:240px;"
@antishok
antishok / auth-popup-callback.html
Last active May 20, 2023 09:23
passport popup login
<!doctype html>
<html>
<head><title>Log-In</title></head>
<script>
if (window.opener) {
window.opener.postMessage("popup-done", "*");
setTimeout(function() { window.close() }, 0);
}
</script>
</head>
@dlindenkreuz
dlindenkreuz / gist:a439ec4b939f0561d6d9
Last active April 9, 2024 10:43 — forked from tyteen4a03/gist:3420a9e121d13b091343
Shopify handleize function in JavaScript
// one-liner version
// retains latin-1 supplement chars as well as latin extended-a and latin extended-b
Shopify.handleize = function (str) {
return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g, "-").replace(/^-+|-+$/g, "");
};
@chrisjhoughton
chrisjhoughton / remove.liquid
Last active November 11, 2024 20:47
Remove a Shopify cart attribute
{% if cart.attributes.yourCartAttribute %}
<script>
$.ajax({
type: 'POST',
url: '/cart/update.js',
data: 'attributes[yourCartAttribute]=',
dataType: 'json'
});
</script>
{% endif %}

Templating engines and React.js

I want to make a shopify theme using react.

How shopify theming works

You have a bunch of template files that have access to global server-side variables with liquid e.g. {{ product.title }}. Think wordpress or any other theme-based system.

 /theme
@raydog
raydog / bullshit.js
Last active October 9, 2024 01:04
Bullshit as a Service
var E_PREFIX_RATE = 0.25;
// All of our word lists:
var _word_lists = {
verb : [
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace",
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize",
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate",
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten