Skip to content

Instantly share code, notes, and snippets.

c = Channel.find 142568
$shopify_session = c.create_shopify_session
ShopifyAPI::Base.activate_session($shopify_session)
include Integrations::Shopify::Paginator
shopify_collection(:product)
sp = _
spids = sp.map(&:id)
spids = spids - c.owners(:product).map(&:online_id).map(&:to_i).uniq
@jasonheecs
jasonheecs / pg_hba.conf
Created February 13, 2019 15:26
Configuration for Postgres 10 for permissionless auth
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or
# "scram-sha-256" are preferred since they send encrypted passwords.
@jasonheecs
jasonheecs / debug.yml
Last active June 5, 2018 12:05
Ansible useful debugger snippet
- name: print to stdout
command: echo $PATH
register: hello
- debug: msg=" {{ hello.stdout }} "
@jasonheecs
jasonheecs / purge.sh
Created December 10, 2017 15:56 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@jasonheecs
jasonheecs / set.txt
Created December 8, 2017 10:04
Set Sale Product Label
<span style="color:red;">Sale items are non-returnable and non-refundable.</span>
@jasonheecs
jasonheecs / what are sections.xml.txt
Created December 14, 2016 10:19
Magento 2 sections.xml
http://magento.stackexchange.com/a/143381
https://mage2.pro/t/topic/1373
@jasonheecs
jasonheecs / move.sh
Created December 14, 2016 08:32
Bash - Move all files in current folder to a subfolder
shopt -s extglob dotglob
mv !(new) new
shopt -u dotglob
@jasonheecs
jasonheecs / move.sh
Created December 13, 2016 08:13
Move files and directories to the parent folder in Linux
# This will move hidden files as well
find . -maxdepth 1 -exec mv {} .. \;
# You will get the message:
# mv: cannot move `.' to `../.': Device or resource busy
# when it tries to move . (current directory) but that won't cause any harm.
@jasonheecs
jasonheecs / mixin.scss
Created April 5, 2016 10:24
Sass mixin to set the placeholder color of input elements
// Set the color of placeholder text in input fields
@mixin set-placeholder-color($color) {
// scss-lint:disable PseudoElement, VendorPrefix
::-webkit-input-placeholder { // WebKit, Blink, Edge
color: $color;
}
:-moz-placeholder { // Mozilla Firefox 4 to 18
color: $color;
opacity: 1;
}
@jasonheecs
jasonheecs / custom.scss
Last active March 1, 2016 03:38
Nice border color and box-shadow effect
$border-shadow-color: generate-border-shadow-color($color-primary);
.input-element {
border-color: $color-primary;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba($border-shadow-color, 0.6);
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s
}
@function generate-border-shadow-color($input-color) {
@return lighten(saturate(adjust-hue($input-color, -0.2273), 23.6585), 14.9020)
}