Skip to content

Instantly share code, notes, and snippets.

View alxpck's full-sized avatar

Alex Peck alxpck

View GitHub Profile
@alxpck
alxpck / teachable_liquid_email_template.liquid
Created April 21, 2017 19:36
Testing liquid variables on Teachable
<!--
Email template: student/purchase_notification
Description: This email is sent to a student when they enroll in a course.
-->
<!-- Email Title -->
<div class="header-title">
<h1>{{text.email_receipts.thank_you_for_enrolling_in }} {{sale.course.name }}</h1>
</div>
@alxpck
alxpck / needsreply.js
Last active April 27, 2018 13:49
JS for Discourse - Add "Needs Reply" to nav menu
<script type="text/discourse-plugin" version="0.8.18">
if (I18n.translations.en) {
I18n.translations.en.js.filters.needsreply = { title: "Posts That Need Love", help: "Projects that need more replies." };
}
// Add active class to Needs Reply button
api.modifyClass('component:navigation-item', {
active: Ember.computed("contentFilterMode", "filterMode", function() {
let contentFilterMode = this.get('content').get('filterMode');
if (window.location.search === "?max_posts=5") {
@alxpck
alxpck / bash_profile
Last active April 29, 2020 16:10
(public) bash_profile
##########
#
# NOTE:
# This file is shared across multiple computers using Dropbox.
#
# SETUP NEW COMPUTER:
# Download and sync Dropbox, including the http directory.
# Create symlinks for the following files in the $HOME/~ dir:
# .bash_profile, .bashrc, .profile (NOT .bash_history)
# e.g. $ ln -s ~/http/config.bash_profile .profile
@alxpck
alxpck / copy_files.sh
Last active December 9, 2016 02:52
Copy files from one directory to another using bash script, run via crontab
# Place this script in /usr/local/bin
# Make the file executable: chmod +x copy_files.sh
# to run via crontab see https://gist.github.com/alxpck/6ad8c1e55fdf58d7a4d434a5e6851b13
#!/bin/bash
# iterate through the files in the directory below (only the ones that end with .md)
for file in $HOME/Dropbox/Writing/Ulysses/booknotes/*.md
# for each file do the following
@alxpck
alxpck / crontab
Last active December 9, 2016 02:51
# EDIT THE CRONTAB
# crontab -e
# Run this script every minute of every day
# Put the output in a log file, there will be a permission error using /var/log
# To fix the permission error (1/2): sudo touch /var/log/foo.log
# To fix the permission error (2/2): sudo chown my_username /var/log/foo.log
* * * * * bash /usr/local/bin/copy_files.sh >> /var/log/markdown_copy_files_output.log 2>&1
/*
* RESPONSIVE LINE BREAKS
* via Dan Mall
* http://danielmall.com/articles/responsive-line-breaks/
*/
/* Default start state */
.rwd-line {
display: block;
}
@media (min-width:970px) and (max-width: 2500px) {
.container {
width:970px;
}
}
<div data-embed_type="product" data-shop="theverybigbook.myshopify.com" data-product_name="What Does It Sound Like When You Change Your Mind?" data-product_handle="what-does-it-sound-like-when-you-change-your-mind" data-has_image="true" data-display_size="compact" data-redirect_to="checkout" data-buy_button_text="Buy" data-buy_button_out_of_stock_text="Out of Stock" data-buy_button_product_unavailable_text="Unavailable" data-button_background_color="0f43be" data-button_text_color="ffffff" data-product_modal="false" data-product_title_color="000000" data-next_page_button_text="Next page"></div>
<script type="text/javascript">
document.getElementById('ShopifyEmbedScript') || document.write('<script type="text/javascript" src="https://widgets.shopifyapps.com/assets/widgets/embed/client.js" id="ShopifyEmbedScript"><\/script>');
</script>
<noscript><a href="https://theverybigbook.myshopify.com/cart/26710869959:1" target="_blank">Buy What Does It Sound Like When You Change Your Mind?</a></noscript>
import csv
import os
import time
import sys
from twilio.rest import TwilioRestClient
# SETH'S TWILIO
account_sid = os.environ.get('TWILIO_ACCOUNT_SID_SETH')
auth_token = os.environ.get('TWILIO_AUTH_TOKEN_SETH')
#!/bin/bash
# This hook is sourced after every virtualenv is activated.
# customize the virtualenv name in the bash prompt
# http://stackoverflow.com/questions/10406926/how-to-change-default-virtualenvwrapper-prompt
if [ ${_OLD_VIRTUAL_PS1:0:2} == '\n' ]; then
PS1="\n\[\033[0;35m\](`basename \"$VIRTUAL_ENV\"`) \n${_OLD_VIRTUAL_PS1:2:${#_OLD_VIRTUAL_PS1}}"
else
PS1="\[\033[$PROMPT_COLOR1\](`basename \"$VIRTUAL_ENV\"`) $_OLD_VIRTUAL_PS1 "