Skip to content

Instantly share code, notes, and snippets.

View jordanhudgens's full-sized avatar

Jordan Hudgens jordanhudgens

View GitHub Profile
class OrdersCreateJob < ActiveJob::Base
def create_usage_charge(product_name, price_to_merchant)
usage_charge = ShopifyAPI::UsageCharge.new(description: product_name, price: price_to_merchant.to_f)
recurring_application_charge = ShopifyAPI::RecurringApplicationCharge.current
usage_charge.prefix_options = { recurring_application_charge_id: recurring_application_charge.id }
usage_charge.save
end
def perform(shop_domain:, webhook:)
<!-- html:5 -->
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title></title>
</head>
<body>
irb(main):018:0> Product.where("LOWER(name) LIKE LOWER(?)", "%dissecting%")
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('serve', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
cd ~/.vim/bundle
git clone https://github.com/prettier/vim-prettier
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
" ================ General Config ====================
class Lineup:
def __init__(self, players):
self.players = players
self.last_player_index = (len(self.players) - 1)
def __iter__(self):
self.n = 0
return self
from functools import reduce
# def manual_exponent(num, exp):
# computed_list = [num] * exp
# return (reduce(lambda total, element: total * element, computed_list))
#
#
# print(manual_exponent(2, 3))
# print(manual_exponent(10, 2))
# print(manual_exponent(3, 3))
import datetime
from time import sleep
for i in range(100):
file_builder = open("logger.txt", "a+")
file_builder.write(f'{datetime.datetime.now()}\n')
file_builder.close()
sleep(2.0)