Skip to content

Instantly share code, notes, and snippets.

View puppycodes's full-sized avatar
💕
ミ●﹏☉ミ

puppycodes

💕
ミ●﹏☉ミ
View GitHub Profile

Keybase proof

I hereby claim:

  • I am puppycodes on github.
  • I am puppycodes (https://keybase.io/puppycodes) on keybase.
  • I have a public key ASA8m5HNTpKwshMV619DPO_C1larZPJ5MrwmxZ842M4kXgo

To claim this, I am signing this object:

#!/bin/bash
export SHELL=$(type -P bash)
targetdir="/var/github"
user=GITHUBUSER
token=ACCESSTOKEN
urls="/users/$user/repos /users/$user/starred"
# actions
# all actions get the following parameter
@puppycodes
puppycodes / Vagrantfile
Last active April 4, 2017 12:08
scumblr
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision :shell, path: "bootstrap.sh"
@puppycodes
puppycodes / puppycodes
Created April 4, 2017 12:13
pawprints
_
| |
_ __ _ _ _ __ _ __ _ _ ___ ___ __| | ___ ___
| _ \| | | | _ \| _ \| | | |/ __/ _ \ / _ |/ _ \/ __|
| |_) | |_| | |_) | |_) | |_| | (_| (_) | (_| | __/\__ \
| __/ \__ _| __/| __/ \__ |\___\___/ \__ _|\___||___/
| | | | | | __/ |
|_| |_| |_| |___/
#!/bin/bash
echo ""
# Root check
if [[ "$UID" -ne 0 ]]; then
echo "!! This script requires root privileges. sudo ./create_koken.sh"
echo ""
exit
fi
curl GET -H 'Content-Type: application/json' 'https://key:pass@shopname.myshopify.com/admin/orders.json'
To fix for a manual gem install:
brew install openssl
gem install mysql2 -- --with-opt-dir="$(brew --prefix openssl)"
To fix for all bundle installs:
brew install openssl
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
bundle install
exports = function(payload, response) {
const mongodb = context.services.get('<your-service-name>');
const collection = mongodb.db("<your-db-name>").collection("<your-collection-name>");
var json = EJSON.parse(payload.body.text());
var user = json.userId;
var status = json.orderStatus;
return collection
.updateOne(
@puppycodes
puppycodes / insert.js
Last active September 7, 2022 08:33
MongoDB Atlas Webhook Functions
exports = function(payload, response) {
// declare mongo services and db
const mongodb = context.services.get('<your-service-name>');
const collection = mongodb.db('<your-db-name>').collection('<your-collection-name>');
// json from webhook into insert function...
// convert body to EJSON for proper formatting
collection.insertOne({
body: EJSON.parse(payload.body.text()),
@puppycodes
puppycodes / regex.txt
Created March 9, 2019 23:51
shopify image asset regex replace
find: ([.|\w|-])*\.(?:jpg|gif|png|svg)
replace: {{'$&' | asset_url}}