Takes a Youtube URL and generates a responsive snippet
{% youtube "https://www.youtube.com/watch?v=ho8-vK0L1_8" %}
or using variables/front matter
| // On external pages (same domain) you need to grab the cookie | |
| function getCookie(name) { | |
| var value = "; " + document.cookie; | |
| var parts = value.split("; " + name + "="); | |
| if (parts.length == 2) return parts.pop().split(";").shift(); | |
| } | |
| var url = "http://t.unbounce.com/trk?v=" + getCookie('ubvt') + "&g=convert" | |
| // On the unbounce page itself you have direct access | |
| var url = "http://t.unbounce.com/trk?v=" + ub.page.visitorId + "&g=convert" |
| // http://stackoverflow.com/questions/11273268/script-import-local-csv-in-google-spreadsheet | |
| function onOpen() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var csvMenuEntries = [{name: "Upload CSV file", functionName: "doGet"}]; | |
| ss.addMenu("CSV", csvMenuEntries); | |
| } | |
| function doGet(e) { | |
| var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); |
| /* | |
| put this file in your app folder and add the following to yout brunch config.coffee | |
| exports.config = | |
| plugins: | |
| staticHandlebars: | |
| includeFile: 'app/translations.js' | |
| # Usage examples: | |
| # {{i18n "key"}} | |
| # {{i18n "key" language="fr"}} |
| var slackTeam = "YOUR_SLACK_TEAM_NAME "; | |
| var token = 'YOUR_ADMIN_TEST_TOKEN'; | |
| // A test token will suffice. | |
| // You can generate one at https://api.slack.com/docs/oauth-test-tokens | |
| // Just make sure that the user issuing the test token is an admin. | |
| var url = 'https://'+ slackTeam + '.slack.com/api/users.admin.invite'; | |
| fetch(url, { | |
| method: 'POST', | |
| headers: {'Content-Type': 'application/x-www-form-urlencoded'}, |
| PAYMENT_GATEWAY_NAME = 'Invoice' | |
| CUSTOMER_TAG = 'VIP' | |
| customer = Input.cart.customer | |
| remove_gateway = (customer.nil? or !customer.tags.include?(CUSTOMER_TAG)) | |
| if remove_gateway | |
| Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway| | |
| payment_gateway.name == PAYMENT_GATEWAY_NAME | |
| end |
| function mamp() { | |
| # | |
| # Default location of the apache conf file for MAMP | |
| CONF_FILE="/Applications/MAMP/conf/apache/httpd.conf" | |
| # | |
| # Fish existing doc root out of conf file | |
| LINE=$(cat $CONF_FILE | grep "^DocumentRoot") | |
| QUOTED_STRING=${LINE/DocumentRoot /} | |
| OLD_DOC_ROOT=${QUOTED_STRING//\"/} | |
| # |
| # Rails controller concern to enable Devise authentication for ActiveStorage. | |
| # Put it in +app/controllers/concerns/blob_authenticatable.rb+ and include it when overriding | |
| # +ActiveStorage::BlobsController+ and +ActiveStorage::RepresentationsController+. | |
| # | |
| # Optional configuration: | |
| # | |
| # Set the model that includes devise's database_authenticatable. | |
| # Defaults to Devise.default_scope which defaults to the first | |
| # devise role declared in your routes (usually :user) | |
| # |
| Image Modifier | |
| Specify Preview Image* | |
| Empty URL* | |
| typed -> Filled URL | |
| Filled URL | |
| submitted -> Select Ad Format | |
| Select Ad Format | |
| selected Single -> Single | |
| selected Carousel -> Carousel | |
| Carousel* |
| #!/usr/bin/env bash | |
| # Enter your license key below | |
| license_key=XXXXXXXXXXXXXXXXX | |
| curl -O -J -L 'https://sendy.co/download/?license=${license_key}' | |
| filename=$(basename -- sendy-*.zip) | |
| newdir="${filename%.*}" | |
| echo ${newdir} |